I was landed a project to debug a PHP SOAP server (SoapServer) written by an unknown party. It is being used by a c# SOAP client, which I don't have access to the source code to (in other words, I cannot use __getLastResponse to see what it gets). I am trying to capture XML output of the server's responses. Traffic sniffing (wireshark, etc) doesn't work because of the SSL layer being used to encrypt XML messages. Any help in figuring out how to see the XML messages sent out by the server would be greatly appreciated.
2 Answers
There's an excellent example for extending the SoapServer class and grabbing the Soap XML request and responses here: http://blog.mayflower.de/archives/179-Extending-class-SoapServer-PHP5-for-debugging.html

- 29
- 2
Does the SoapServer look like this one, or like this one? If it's the former, you're up a tree and every ladder within a year's distance has been violently destroyed by wolverines. Rather, it's a binary blob of compiled code from which there is no escape.
If it's the latter, you may have some hope -- the service
method's third parameter can be set to true to get the response data rather than blindly sending it out.
There's also a rumor that the ancient "nuSOAP" library has a server mode, but that project seems to have imploded in upon itself, and took the documentation with it.
Long-term, you may be better served by using a web service layer that isn't pathologically backwards, though that might not be an option for you.

- 50,943
- 13
- 104
- 142
-
+1 for the awesome link (The S stands for Simple) and good explanation – Alex Bailey Mar 21 '11 at 21:46
-
Thanks, @Charles... it's the former. I'm trying to capture it using other means - ob_*, for instance, but nothing seems to work. – user670102 Mar 22 '11 at 17:53
-
1Yeah, they did a fantastically horrible job designing that one. Good luck. – Charles Mar 22 '11 at 17:56
-
SoapServer is PHP's native SOAP API and Soap_Server is a pear module which predates it. nuSOAP is PHP 4 and is dead because the native functionality in PHP5 rendered it unnecessary and I wouldn't be surprised if the pear soap extension was the same. SoapServer is a PHP extension, so debugging through it is a pain, but it's probably the nest option currently, and most likely to be supported in the log term. – Jim OHalloran Jul 11 '12 at 01:44