I am trying to make a SOAP call through a Spring Boot application. The call is returned with statuscode 400 and a SOAP envelope with no content. When the response is processed by WebServiceTemplate, it is characterized as an error and not a fault, and it seems like the SOAP web service I’m trying to reach doesen’t recognize the request at all. The response looks like this:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body/>
</SOAP-ENV:Envelope>
I have debugged the request, and recreated it in postman / insomnia. When posting from either request tool, it seems to work fine. Even if I send trash values for the HTTP headers or the xml body, I get a response like below, along with code 400:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Client</faultcode>
<faultstring>RequestDataInvalid Request data is invalid.</faultstring>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Even if the request contains illegal values, the webservice I’m trying to reach seems to at least recognize the request.
What is the difference between an error and a fault? A big step in solving the problem would be to know why my invalid request is considered an error and not a fault. Can it be that this might be related to connection / network issues? When looking at the SOAP web service URL, it seems like the service has some kind of relation to Microsoft Dynamics Business Central.
Base url:
https://api.businesscentral.dynamics.com
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…