From my PHP program, I am successfully able to send a SOAP/HTP request to a remote server. Using wireshark/etheral, I confirmed that the expected response is being obtained from the remote server. Using SoapUI and wireshark/ethereal , I further confirmed that request/response in SoapUI and wireshark are exactly the same.
However, in my PHP program I am not receiving the SOAP response.
Please review the code snippet and comments and advise.
// Open the Socket
$fp = fsockopen('stage.xxxxxx.com',80,$errno,$errstr,30);
// TEST FOR VERIFICATION
if (!$fp) // HTTP ERROR
die("fsockopen() FAILED \n\n ERRNO=$errno \n\n
// WITH HTTP OPEN - WRITE HEADER AND REQUEST
// Header and Request have been properly created and
// confirmed via echo command, SoapUI and wireshark
fputs ($fp, $header . $xml);
// HTTP OPEN - READ WEBSERVICE RESPONSE, INCLUDING HEADERS
// AND BODY
$reply = '';
$reply .= fgets ($fp, 128);
// Upon executing the above, I get the following error msg:
// Fatal error: Maximum execution time of 60 seconds exceeded
// and it mentions the fgets line
// Instead of fputs, I also tried fwrite and I get the
// following output when I attempt to echo the response
HTTP/1.1 200 OK Date: Fri, 20 Aug 2010 02:10:56 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET X-AspNet-Version: 4.0.30319 Cache-Control: private, max-age=0 Content-Type: application/soap+xml; charset=utf-8 Content-Length: 3543 Fatal error: Maximum execution time of 60 seconds exceeded
// From the above it seems the the content is there since it is showing a content length of 3543. However I am not being able to see and access the content