如何處理下面的SOAP消息響應?SOAP響應正文具有純文本,沒有任何節點
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/" xmlns:new="http://foo/bar"> <S:Header/> <S:Body>OK</S:Body> </S:Envelope>
這裏是我的定義在WSDL:
<wsdl:operation name="MyRequest">
<wsdl:input message="tns:MyRequest" name="MyRequest">
</wsdl:input>
<wsdl:output message="tns:MyRequestResponse" name="MyRequestResponse">
</wsdl:output>
</wsdl:operation>
<xs:element name="MyRequestResponse" type="xs:string"/>
服務:
@WebMethod(operationName = "MyRequest")
@WebResult(name = "MyRequestResponse", targetNamespace = "http://foo/bar", partName = "parameters")
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
public String MyRequest(
@WebParam(name = "MyRequest", targetNamespace = "http://foo/bar", partName = "parameters")
MyRequest parameters);
我也嘗試過使用攔截器和包裝與節點響應 'OK'。但是,想知道是否有通過在JAXB/WSDL層本身進行處理的更乾淨的方式。
您是否正在嘗試生成或使用OK響應? – approxiblue
我試圖從騾ESB消耗它。 – HanuAthena
根據您的WSDL,此SOAP響應**無效**。你應該有這樣的事情: <新:MyRequestResponse的xmlns:新= 「HTTP://富/欄」>確定新:MyRequestResponse> \t 你真的使用JAX-WS實現產生這種反應? –
cdan