A complete answer goes as follow.
While you are using WebServiceTemplate
as a class to communicate with the Webservice, I do not understand why but it does not properly fill the HTTP Header.
Some WSDL have a part saying:
<soap:operation
soapAction="SOMELINK"
style="document" />
And the WebServiceTemplate
ignores this part. The above error means that your soapAction
parameter in the header is empty. And it should be not. Check with Wireshark. I did - using some Chrome Soap client and Spring. The second one has an invalid header.
To fix this you need to follow Section 6.2.4 in here: http://docs.spring.io/spring-ws/sites/2.0/reference/html/client.html
What it says is basically add the header part on your own, with WebServiceMessageCallback
interface. You can read more in the reference.
Basically it ends up like this:
webServiceTemplate.marshalSendAndReceive(o, new WebServiceMessageCallback() {
public void doWithMessage(WebServiceMessage message) {
((SoapMessage)message).setSoapAction("http://tempuri.org/Action");
}
});
Where you can set up properly the header value. Worked for me too. Whole day of reading.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…