NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
seeing the SOAP Xml Structure


Joined: 11 Jul 2008
Posts: 1
Reply with quote
hi all.

i am pretty new to php but i am not new to development.
i have a client who is using nusoap to send an envelope to an API at a 3rd party site. the api is not really working well and the 3rd party wants me to send the xml thats generated by the SOAP request to their tech team to look at.

We are using the nusoap_client to call a function on the 3rd parties api and all that works fine, we are just getting some weird error messages passed back. i want to know if there is a function or method i can use to actually print out the xml from the object we have built.

does nusoap have a function call that can do this? or how can i view the xml that is being sent to the api?

thanks in advance,
mcm
View user's profileFind all posts by mcmcomSend private message


Joined: 14 Jun 2007
Posts: 67
Reply with quote
Use something like:

Code:
ob_start(); // start an output buffer

$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$soap_server->service($HTTP_RAW_POST_DATA);

$contents = ob_get_flush(); // store the XML in $contents and flush the buffer to the output

file_put_contents($filename, $contents); // save $contents to a file

I'll leave the actual implementation up to you.
View user's profileFind all posts by CjungeSend private message
seeing the SOAP Xml Structure
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic