[SalesForce] Calling a SOAP service through HTTP Request

This is a broad general question .

We already have a SOAP callout in place where we are hitting the endpoint url after creating the request header and other necessary elements and hitting the method in stub .

Question – How can I make the same callout using HTTP callout ?

How do we send the request xml to the endpoint?

Best Answer

You can hand code your own manual XML POST callout using HttpRequest. It will be on you to build up the required XML and then parse the response.


Alternatively, if you have a WSDL to work from, I created an alternative version of WSDL2Apex.

When you import the WSDL you are presented with a list of methods to import. At that stage you can opt to generate the Apex required to perform the HttpRequest.

Related Topic