views:

157

answers:

1

I'm sending a ACK response back to a SOAP request (via Salesforce) and I would like to capture what I'm sending back to SF. Now I seen some stuff online that uses ob_start (or one of the ob_ functions) to record the response but I've never used ob_ before and after Googling for a while didn't find anything I could use/follow.

The Problem: Salesforce sends an outbound message to my server via SOAP, I process the message and send back a ACK file to SF. I want to log/record the message (and anything else) I'm sending back to SF. How can I do this?

+1  A: 

Yes, anything you write to the output buffer can be captured using

ob_start();
// create and send your SOAP message
// ...
$mystring = ob_get_contents(); // retrieve all output thus far
ob_end_clean ();               // stop buffering
log($mystring);                // log it 
echo $mystring;                // now send it
Martin Wickman
Thanks that worked
Phill Pafford