我使用Spring-WS,并呼吁从webServiceTemplate通过marshalSendAndReceive Web服务时,我得到一个SOAP错误,错误代码500。 不幸的是,响应没有被识别为一个SOAP错误(它扔WebServiceTransportException)。 从理论上讲,当有错误响应,WebServiceTemplate抛出一个WebServiceTransportException如果错误码是2XX不同, 除非 HTTP错误是500和内容是肥皂故障。 下面是我得到的回应的例子:
HTTP/1.1 500 Internal Server Error[\r][\n]"
Content-Length: 887[\r][\n]"
Connection: keep-alive[\r][\n]"
2015-07-01 10:38:22,873 DEBUG [o.s.ws.client.core.WebServiceTemplate] Received error for request [SaajSoapMessage {http://www.example.com/schema/front}use]
2015-07-01 10:38:22,874 DEBUG [org.apache.http.wire] << "<?xml version="1.0" encoding="UTF-8"?>[\n]"
2015-07-01 10:38:22,874 DEBUG [org.apache.http.wire] << "[\n]"
2015-07-01 10:38:22,874 DEBUG [org.apache.http.wire] << "<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">[\n]"
2015-07-01 10:38:22,874 DEBUG [org.apache.http.wire] << " <SOAP-ENV:Body>[\n]"
2015-07-01 10:38:22,875 DEBUG [org.apache.http.wire] << " <SOAP-ENV:Fault>[\n]"
2015-07-01 10:38:22,875 DEBUG [org.apache.http.wire] << " <faultcode>SOAP-ENV:Server</faultcode>[\n]"
2015-07-01 10:38:22,875 DEBUG [org.apache.http.wire] << " <faultstring>Request service/operation version not supported</faultstring>[\n]"
2015-07-01 10:38:22,875 DEBUG [org.apache.http.wire] << " <faultactor>Server</faultactor>[\n]"
2015-07-01 10:38:22,875 DEBUG [org.apache.http.wire] << " <detail>[\n]"
2015-07-01 10:38:22,875 DEBUG [org.apache.http.wire] << " <ns0:serviceException xmlns:ns0="http://www.example.com/facade/interface/v1_1">[\n]"
2015-07-01 10:38:22,875 DEBUG [org.apache.http.wire] << " <ns1:message xmlns:ns1="http://www.example.com/common/v1_3">InternalCode01</ns1:messageId>[\n]"
2015-07-01 10:38:22,875 DEBUG [org.apache.http.wire] << " <ns1:text xmlns:ns1="http://www.example.com/common/v2_1">Request service/operation version not supported</ns1:text>[\n]"
2015-07-01 10:38:22,875 DEBUG [org.apache.http.wire] << " </ns0:serviceException>[\n]"
2015-07-01 10:38:22,875 DEBUG [org.apache.http.wire] << " </detail>[\n]"
2015-07-01 10:38:22,875 DEBUG [org.apache.http.wire] << " </SOAP-ENV:Fault>[\n]"
2015-07-01 10:38:22,875 DEBUG [org.apache.http.wire] << " </SOAP-ENV:Body>[\n]"
2015-07-01 10:38:22,875 DEBUG [org.apache.http.wire] << "</SOAP-ENV:Envelope>"
有谁知道为什么会发生? 有没有办法,只是把它作为SOAP错误它是什么?