+ Start a Discussion
Giorgio PorroGiorgio Porro 

How to view the XML file generated by a SOAP API callout

Hello

I developed an API callout to a SOAP webservice.
How can I see the actual XML message being generate by the invoke methid?
I call the invoke method below:


WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              '',
              'iRT_XIFIN_Client',
              'RequestMessage',
              'iRT_XIFIN_Client',
              'ResponseMessage',
              'iRT_XIFIN_Client.ResponseMessage_element'}
            );
            
and my webservice expects something like this

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cli="http://www.xifin.com/schema/client" xmlns:msg="http://www.xifin.com/schema/msgHeader">
   <soapenv:Header/>
   <soapenv:Body>
      <cli:RequestMessage>
         <msg:MessageHeader>
            
            <msg:SequenceNumber>1</msg:SequenceNumber><msg:UserId>Tester</msg:UserId>          
            <msg:SourceApplication>?</msg:SourceApplication><msg:OrgAlias>irhythmtest</msg:OrgAlias>          
         </msg:MessageHeader>
         <cli:Payload>                                                                
         <cli:GetClient><cli:ClientId>883</cli:ClientId></cli:GetClient></cli:Payload>
      </cli:RequestMessage>
   </soapenv:Body>
</soapenv:Envelope>

Thanks
Giorgio
Best Answer chosen by Giorgio Porro
Doug Hynes NIDoug Hynes NI
You can't see the SOAP request XML in Salesforce debug, but you can send it to some intermediary or site where you can inspect the result.

Check out: http://requestb.in/

I think there are more elegant sites that do this (but can't find right now), but this one will work. Just go to http://requestb.in in your browser, create a request bin, then set your SOAP endpoint URL to it. Then execute the call in Salesforce and you'll see the request in the bin. You'll also need to add the url to Remote Site Settings.