views:

68

answers:

1
+1  Q: 

PHP WSO2's WSF/PHP

I am trying to use WSO2' WSF for PHP and I am using a WS Security object. I am making the request to the server and getting an Authentication error. I believe the WS Security Object is missing something, so I would like to see the RAW SOAP message being sent...Is there a way to do this.

I am not doing this locally.

+1  A: 

This is pretty straightforward. Construct your SOAP client like so:

$client = new SoapClient($wsdl_url, array('location' => $endpoint_url, 'trace' => true));

Then, after you've sent your message, just call $client->__getLastRequest() or $client->__getLastResponse() as appropriate. You can also call $client->__getLastRequestHeaders() or $client->__getLastResponseHeaders().

Note that it is not possible to get any of this before sending the message. You must first send the SOAP message.

Also, you may find http://us.php.net/soapclient helpful.

benjy
I am not using the default PHP soap client I am using WSO2's, but that got me looking to see if it had a similar method. so $client->getLastRequest() is what i was looking for thanks!
dorgan