SOAP调用在Websphere上部署时失败

SOAP调用在Websphere上部署时失败

本文介绍了SOAP调用在Websphere上部署时失败,但在tomcat上可以正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个spring boot soap客户端,当我在tomcat上运行它时,它工作正常,但是当我在websphere上部署相同的客户端时,SOAP调用失败,并显示以下消息.它抱怨

I have a spring boot soap client that works fine when I run it on tomcat but when I deploy the same client on websphere, the SOAP call fails with the following message. It complaining that the

public void doWithMessage(WebServiceMessage message) {
    try {
        SoapMessage soapMessage = (SoapMessage) message;
        SoapHeader header = soapMessage.getSoapHeader();
        StringSource headerSource = new StringSource(
                "<clientVersion>" + clientVersionNumber + "</clientVersion>");
        Transformer transformer = TransformerFactory.newInstance().newTransformer();
        transformer.transform(headerSource, header.getResult());
    } catch (Exception e) {
        e.printStackTrace();
    }
}

[24/02/20 15:06:56:239 EST] 000000c7 SystemErr     R FATAL ERROR:  'java.lang.RuntimeException: javax.xml.soap.SOAPException: WSWS4119E: An attempt was made to set a SOAPHeaderElement that was not namespace qualified. The SOAPHeaderElement localName is clientVersion; prefix is null: namespace is null.'
           :javax.xml.soap.SOAPException: WSWS4119E: An attempt was made to set a SOAPHeaderElement that was not namespace qualified. The SOAPHeaderElement localName is clientVersion; prefix is null: namespace is null.
[24/02/20 15:06:56:342 EST] 000000c6 AxisEngine    E org.apache.axis2.engine.AxisEngine receive An error was detected during JAXWS processing
                                 org.apache.axis2.AxisFault: An error was detected during JAXWS processing
    at org.apache.axis2.jaxws.server.JAXWSMessageReceiver.receive(JAXWSMessageReceiver.java:208)
    at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:212)
    at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:172)
    at com.ibm.ws.websvcs.transport.http.WASAxis2Servlet.doPost(WASAxis2Servlet.java:1633)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1235)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:779)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
    at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:179)
    at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1124)
    at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:82)
    at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:963)
    at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1817)
    at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:382)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:465)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:532)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:318)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:289)
    at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
    at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
    at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
    at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
    at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
    at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
    at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
    at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
    at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1909)

[24/02/20 15:06:56:376 EST] 000000c7 SystemOut     O Excpetion caught: null
[24/02/20 15:06:56:361 EST] 000000c7 SystemErr     R org.springframework.ws.soap.client.SoapFaultClientException: Internal Error
[24/02/20 15:06:56:361 EST] 000000c7 SystemErr     R    at org.springframework.ws.soap.client.core.SoapFaultMessageResolver.resolveFault(SoapFaultMessageResolver.java:38)
[24/02/20 15:06:56:361 EST] 000000c7 SystemErr     R    at org.springframework.ws.client.core.WebServiceTemplate.handleFault(WebServiceTemplate.java:830)
[24/02/20 15:06:56:361 EST] 000000c7 SystemErr     R    at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:624)
[24/02/20 15:06:56:362 EST] 000000c7 SystemErr     R    at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:555)
[24/02/20 15:06:56:362 EST] 000000c7 SystemErr     R    at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:390)
[24/02/20 15:06:56:362 EST] 000000c7 SystemErr     R    at client.tphehtvc.service.SoapClient.callRemoteService(SoapClient.java:89)
[24/02/20 15:06:56:362 EST] 000000c7 SystemErr     R    at client.tphehtvc.service.SoapClient.getScheduledWorkHH(SoapClient.java:142)
[24/02/20 15:06:56:362 EST] 000000c7 SystemErr     R    at client.tphehtvc.controller.ScheduleWork.getScheduledWorkHH(ScheduleWork.java:416)
[24/02/20 15:06:56:362 EST] 000000c7 SystemErr     R    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[24/02/20 15:06:56:362 EST] 000000c7 SystemErr     R    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:90)
[24/02/20 15:06:56:362 EST] 000000c7 SystemErr     R    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
[24/02/20 15:06:56:362 EST] 000000c7 SystemErr     R    at java.lang.reflect.Method.invoke(Method.java:508)
[24/02/20 15:06:56:363 EST] 000000c7 SystemErr     R    at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)
[24/02/20 15:06:56:363 EST] 000000c7 SystemErr     R    at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)
[24/02/20 15:06:56:363 EST] 000000c7 SystemErr     R    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:106)
[24/02/20 15:06:56:363 EST] 000000c7 SystemErr     R    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:888)
[24/02/20 15:06:56:363 EST] 000000c7 SystemErr     R    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:793)
[24/02/20 15:06:56:363 EST] 000000c7 SystemErr     R    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
[24/02/20 15:06:56:363 EST] 000000c7 SystemErr     R    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040)
[24/02/20 15:06:56:363 EST] 000000c7 SystemErr     R    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943)
[24/02/20 15:06:56:363 EST] 000000c7 SystemErr     R    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
[24/02/20 15:06:56:364 EST] 000000c7 SystemErr     R    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898)
[24/02/20 15:06:56:364 EST] 000000c7 SystemErr     R    at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
[24/02/20 15:06:56:364 EST] 000000c7 SystemErr     R    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
[24/02/20 15:06:56:364 EST] 000000c7 SystemErr     R    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
[24/02/20 15:06:56:364 EST] 000000c7 SystemErr     R    at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1235)
[24/02/20 15:06:56:364 EST] 000000c7 SystemErr     R    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:779)
[24/02/20 15:06:56:364 EST] 000000c7 SystemErr     R    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
[24/02/20 15:06:56:364 EST] 000000c7 SystemErr     R    at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:179)
[24/02/20 15:06:56:364 EST] 000000c7 SystemErr     R    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:143)
[24/02/20 15:06:56:365 EST] 000000c7 SystemErr     R    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:96)
[24/02/20 15:06:56:365 EST] 000000c7 SystemErr     R    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:320)
[24/02/20 15:06:56:365 EST] 000000c7 SystemErr     R    at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:126)
[24/02/20 15:06:56:365 EST] 000000c7 SystemErr     R    at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:90)
[24/02/20 15:06:56:365 EST] 000000c7 SystemErr     R    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
[24/02/20 15:06:56:365 EST] 000000c7 SystemErr     R    at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:118)
[24/02/20 15:06:56:365 EST] 000000c7 SystemErr     R    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
[24/02/20 15:06:56:365 EST] 000000c7 SystemErr     R    at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137)
[24/02/20 15:06:56:365 EST] 000000c7 SystemErr     R    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
[24/02/20 15:06:56:366 EST] 000000c7 SystemErr     R    at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111)
[24/02/20 15:06:56:366 EST] 000000c7 SystemErr     R    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
[24/02/20 15:06:56:366 EST] 000000c7 SystemErr     R    at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:158)
[24/02/20 15:06:56:366 EST] 000000c7 SystemErr     R    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
[24/02/20 15:06:56:366 EST] 000000c7 SystemErr     R    at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)
[24/02/20 15:06:56:366 EST] 000000c7 SystemErr     R    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
[24/02/20 15:06:56:366 EST] 000000c7 SystemErr     R    at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:200)
[24/02/20 15:06:56:366 EST] 000000c7 SystemErr     R    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
[24/02/20 15:06:56:367 EST] 000000c7 SystemErr     R    at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116)
[24/02/20 15:06:56:367 EST] 000000c7 SystemErr     R    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
[24/02/20 15:06:56:367 EST] 000000c7 SystemErr     R    at org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:92)
[24/02/20 15:06:56:367 EST] 000000c7 SystemErr     R    at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:77)
[24/02/20 15:06:56:367 EST] 000000c7 SystemErr     R    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
[24/02/20 15:06:56:367 EST] 000000c7 SystemErr     R    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
[24/02/20 15:06:56:367 EST] 000000c7 SystemErr     R    at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105)
[24/02/20 15:06:56:367 EST] 000000c7 SystemErr     R    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
[24/02/20 15:06:56:367 EST] 000000c7 SystemErr     R    at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56)
[24/02/20 15:06:56:368 EST] 000000c7 SystemErr     R    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
[24/02/20 15:06:56:368 EST] 000000c7 SystemErr     R    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
[24/02/20 15:06:56:368 EST] 000000c7 SystemErr     R    at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:215)
[24/02/20 15:06:56:368 EST] 000000c7 SystemErr     R    at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178)
[24/02/20 15:06:56:368 EST] 000000c7 SystemErr     R    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:358)
[24/02/20 15:06:56:368 EST] 000000c7 SystemErr     R    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:271)
[24/02/20 15:06:56:368 EST] 000000c7 SystemErr     R    at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:197)
[24/02/20 15:06:56:369 EST] 000000c7 SystemErr     R    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:90)
[24/02/20 15:06:56:369 EST] 000000c7 SystemErr     R    at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
[24/02/20 15:06:56:369 EST] 000000c7 SystemErr     R    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
[24/02/20 15:06:56:369 EST] 000000c7 SystemErr     R    at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:197)
[24/02/20 15:06:56:369 EST] 000000c7 SystemErr     R    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:90)
[24/02/20 15:06:56:369 EST] 000000c7 SystemErr     R    at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
[24/02/20 15:06:56:369 EST] 000000c7 SystemErr     R    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
[24/02/20 15:06:56:369 EST] 000000c7 SystemErr     R    at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:197)
[24/02/20 15:06:56:369 EST] 000000c7 SystemErr     R    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:90)
[24/02/20 15:06:56:370 EST] 000000c7 SystemErr     R    at org.springframework.boot.web.servlet.support.ErrorPageFilter.doFilter(ErrorPageFilter.java:128)
[24/02/20 15:06:56:370 EST] 000000c7 SystemErr     R    at org.springframework.boot.web.servlet.support.ErrorPageFilter.access$000(ErrorPageFilter.java:66)
[24/02/20 15:06:56:370 EST] 000000c7 SystemErr     R    at org.springframework.boot.web.servlet.support.ErrorPageFilter$1.doFilterInternal(ErrorPageFilter.java:103)
[24/02/20 15:06:56:370 EST] 000000c7 SystemErr     R    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
[24/02/20 15:06:56:370 EST] 000000c7 SystemErr     R    at org.springframework.boot.web.servlet.support.ErrorPageFilter.doFilter(ErrorPageFilter.java:121)
[24/02/20 15:06:56:370 EST] 000000c7 SystemErr     R    at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:197)
[24/02/20 15:06:56:370 EST] 000000c7 SystemErr     R    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:90)
[24/02/20 15:06:56:371 EST] 000000c7 SystemErr     R    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
[24/02/20 15:06:56:371 EST] 000000c7 SystemErr     R    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
[24/02/20 15:06:56:371 EST] 000000c7 SystemErr     R    at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:197)
[24/02/20 15:06:56:372 EST] 000000c7 SystemErr     R    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:90)
[24/02/20 15:06:56:372 EST] 000000c7 SystemErr     R    at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:969)
[24/02/20 15:06:56:372 EST] 000000c7 SystemErr     R    at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1109)
[24/02/20 15:06:56:372 EST] 000000c7 SystemErr     R    at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:4219)
[24/02/20 15:06:56:373 EST] 000000c7 SystemErr     R    at com.ibm.ws.webcontainer.webapp.WebAppImpl.handleRequest(WebAppImpl.java:2208)
[24/02/20 15:06:56:373 EST] 000000c7 SystemErr     R    at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304)
[24/02/20 15:06:56:373 EST] 000000c7 SystemErr     R    at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1030)
[24/02/20 15:06:56:373 EST] 000000c7 SystemErr     R    at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1817)
[24/02/20 15:06:56:374 EST] 000000c7 SystemErr     R    at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:382)
[24/02/20 15:06:56:374 EST] 000000c7 SystemErr     R    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:465)
[24/02/20 15:06:56:374 EST] 000000c7 SystemErr     R    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:532)
[24/02/20 15:06:56:374 EST] 000000c7 SystemErr     R    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:318)
[24/02/20 15:06:56:375 EST] 000000c7 SystemErr     R    at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:88)
[24/02/20 15:06:56:375 EST] 000000c7 SystemErr     R    at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
[24/02/20 15:06:56:375 EST] 000000c7 SystemErr     R    at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
[24/02/20 15:06:56:375 EST] 000000c7 SystemErr     R    at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
[24/02/20 15:06:56:375 EST] 000000c7 SystemErr     R    at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
[24/02/20 15:06:56:375 EST] 000000c7 SystemErr     R    at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
[24/02/20 15:06:56:375 EST] 000000c7 SystemErr     R    at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
[24/02/20 15:06:56:375 EST] 000000c7 SystemErr     R    at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
[24/02/20 15:06:56:375 EST] 000000c7 SystemErr     R    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1909)

有人可以告诉我如何正确设置SOAPHeaderElement吗?

Can someone show me how I can correctly set the SOAPHeaderElement?

推荐答案

我找到了解决此问题的两种方法.

I found two solutions to this issue.

  1. 更改Web模块的classloaderMode ="PARENT_LAST".
  2. 使用SoapHeaderElement代替StringSource

  1. Change the classloaderMode="PARENT_LAST" for the web module.
  2. Use a SoapHeaderElement instead of StringSource

public void doWithMessage(WebServiceMessage message) {
  try {
    SoapMessage soapMessage = (SoapMessage) message;
    SoapHeader header = soapMessage.getSoapHeader();
    SoapHeaderElement messageId =  header.addHeaderElement(
            new QName("http://<namespace>", "clientVersion", ""));
    messageId.setText(clientVersionNumber);

  } catch (Exception e) {
    e.printStackTrace();
  }
}

这篇关于SOAP调用在Websphere上部署时失败,但在tomcat上可以正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-27 19:57