Sending a SOAP request to some URL in Spring Boot

31 Views Asked by At

I'm trying to send a request to an a SOAP API from my Spring Boot app. The request object I generate starts and ends with tags like <pricing>. But I keep getting an error from the API saying wrong version. I'm really lost on how I can properly generate a full XML request in the correct format and send it .I also should note tht i already have my java objects and don t have the api's wsdl.is it possible.

1

There are 1 best solutions below

1
Mar-Z On

Your SOAP message must have a XML version tag, the envelope and body. Like this:

<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2003/05/soap-envelope/"
soap:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
<soap:Body>
... here goes your XML message
</soap:Body>
</soap:Envelope>