PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
$client = new SoapClient('wsdl_location', array("trace" => true, "exceptions" => true, 'soap_version' => SOAP_1_2));
// And for debuging the request and response I do this:
if ($debug)
{
print "<pre>\n";
print "Request :\n".htmlspecialchars($client->__getLastRequest()) ."\n";
print "Response:\n".htmlspecialchars($client->__getLastResponse())."\n";
print "</pre>";
}
But I want to do logging of requests and responses at the Server End. For example at the Server end I can do the following:
// Int theConstructor of the Webservices class I have:
$xml_request = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : file_get_contents("php://input");
The above gets me the Soap Request Envelope. Now I also want to capture whats going out as the SOAP response. But I am stuck. Any suggestions?