需要使用Sprint WS查询基于SOAP的端点 - 但这里不是传递XML有效负载,而是传递生成的SOAP请求本身。我现在正在使用org.springframework.ws.client.core.WebServiceTemplate吗?
答案 0 :(得分:0)
您可以执行以下操作:
ClientMessageCallBack _callBack =
new ClientMessageCallBack("yournamespaceuri/operationx");
final String _message =
"<ns1:operationx xmlns:ns1="yournamespaceuri"></ns1:operationx>";
StreamSource _source = new StreamSource(new StringReader(_message));
// the result will be output in the console
StreamResult _result = new StreamResult(System.out);
// suppose you have a reference to webServiceTemplate
webServiceTemplate.sendSourceAndReceiveToResult(_source,_callBack, _result);