Header sample.gif

Printing Raw XML

It can be helpful to print out the raw XML request and/or XML response when interacting with the SOAP API for debuggin purposes. Below are sample calls.

XML Request To get the last XML request, simply call getLastRequest on the connection.

Here is a code snippet:

  ...
  $mySforceConnection = new SforceEnterpriseClient();
  $mySoapClient = $mySforceConnection->createConnection('enterprise.wsdl.xml');
  $mylogin = $mySforceConnection->login($USERNAME, $PASSWORD);
  ...
  echo $mySforceConnection->getLastRequest();
  ...