function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Oscar BecerraOscar Becerra 

How to debug a soap request generated by the WebServiceCallout.invoke method

Hi,

I am having some trouble to send data to an external interface in some client's legacy system of which I have no admin access. I am getting the error System.CalloutException: Web service callout failed: WebService returned a SOAP Fault: Server was unable to process request. ---> Server Error faultcode=soap:Server faultactor=

I am consuming the web service using the WebServiceCallout.invoke method of a class generated by the wsdl2apex tool. If I instead create the request manually using the HttpRequest class, there is no fault, returning the expected response.

It seems there is no way to output the SOAP request headers and body content when the callout is invoked by the generated method. I can only print the structure of the data sent using debug logs, but not the actual SOAP Envelope.

Also, do you know what's the possible reasons that make this error to pop out?

Regards
Oscar Becerra