java Web服务SOAP客户端可以在Tomcat上运行,但不能在IBM Web Sphere上运行-验证错误

ztmd8pv5  于 2022-12-02  发布在  Java
关注(0)|答案(1)|浏览(140)

I have Web Service, which works well on Tomcat 7.0, (Java 7) but not on Web Sphere. Probably, there is problem with libraries, but I don't know, how to find out this App WAS Server specific problem.
Client Implementation use Spring WS SOAP a Spring WS Core:

import org.springframework.ws.client.core.support.WebServiceGatewaySupport;
import org.springframework.ws.soap.SoapFaultException;
import org.springframework.ws.soap.client.SoapFaultClientException;
...     
public KonverzeResponse convert(KonverzeRequest request)
            throws Exception, SoapFaultClientException, SoapFaultException {

        KonverzeResponse response = (KonverzeResponse) getWebServiceTemplate().marshalSendAndReceive(request);

        if (response == null /* || response.getValue() == null */)
            throw new Exception("Response is empty.");

        return response/* .getValue() */;
    }

Tomcat issues success, WAS issues:
[11/6/18 18:02:01:030 CET] 000000d8 SystemOut O 2018-11-06 18:02:01,029 ERROR [WebContainer : 7] ComponentServiceFacadeImpl - Client Error, Failed to Accept Converted File or Other Error. org.springframework.ws.soap.client.SoapFaultClientException: Validation error at org.springframework.ws.soap.client.core.SoapFaultMessageResolver.resolveFault(SoapFaultMessageResolver.java:37) at org.springframework.ws.client.core.WebServiceTemplate.handleFault(WebServiceTemplate.java:776) at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:602) at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:539) at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:386) at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:380) at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:372) at cz.legend.mzv.spi.ws.clients.convertor.ConvertorClient.convert(ConvertorClient.java:63) at cz.legend.mzv.spi.ws.clients.convertor.interfaces.ConvertorServiceImpl.convertFnFile(ConvertorServiceImpl.java:103)
Related documentation:
https://www.ibm.com/mysupport/s/topic/0TO500000001DQQGA2/websphere-application-serverhttps://www.ibm.com/support/knowledgecenter/SSAW57_8.5.5/com.ibm.websphere.nd.multiplatform.doc/ae/twbs_thirdparty.htmlhttps://www.ibm.com/support/knowledgecenter/SSAW57_8.5.5/com.ibm.websphere.nd.multiplatform.doc/ae/twbs_jaxrs_migrate_web20.htmlhttps://www-01.ibm.com/support/docview.wss?uid=swg21639407https://www.ibm.com/support/knowledgecenter/SSAW57_8.5.5/com.ibm.websphere.messages.doc/com.ibm.ws.websvcs.resources.websvcsMessages.html

ecbunoof

ecbunoof1#

第一个计划中的验证错误意味着请求/响应不是预期的形状。首先根据定义检查请求。记录器具有用于启用将请求/响应打印到日志中的选项。E.q. log4j.properties具有用于Spring WS的选项:

# Spring WS
log4j.logger.org.springframework.ws.client.MessageTracing=TRACE
log4j.logger.org.springframework.ws.server.MessageTracing=DEBUG

找出关键字Envelope,复制Request的内容并在某个独立工具中检查,该工具用于检查SOAP请求-例如SoapUI等。如果响应中是Validation error,则检查Request。
在我的例子中,我省略了这一步,并关注于可能不同的不兼容库。这是错误的。问题在于Tomcat和Web Sphere上代码的不同行为-一些资源无法访问,并且有错误处理的异常。结果是,Tomcat和Web Sphere上的请求不同。

相关问题