Re: SV: Read the SOAP return

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jeppe Donslund wrote:

<snip />

# Print response
print "<html><body>";

print "SOAP Response Message<br /><textarea name='resultmessage' rows='50' nowrap cols='80'>";

$fp2 = fpassthru($fp);
print "</textarea></form><br><br>\n\n";

It returns "something" and prints it in an textarea. I can't get output else where. I guess you are right it is an object, but how do I read this output?

Ok, you are working with raw SOAP messages, which is going to make it difficult for you anyways if you want only the resulting payload.

Your current problem, however, is not SOAP related but due to how you are interacting with the server. fpassthru sends the resulting data directly to the output buffer (so you only get the output within the text area because that is where you places the fpassthru call). $fp2 will only contain the length of the resulting data. You could change it to do something like the following to get $fp2 to contain the resulting data (all of it mind you).

fwrite($fp, $query.$holdsoap); /* instead of the fputs calls */
while (!feof($fd))
   $fd2.=fread($fd, 1024);

$fd2 will now contain the entire response (including the headers)

A few recommendations:
if you dont want to worry about transport, the message or parsing XML
	- use ext/soap or PEAR SOAP
if you do want control over the above but dont want to deal with parsing headers
	- use PHP streams or CURL

What you pick really is dependent upon what version of PHP you are using.

Rob

--
PHP Soap Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Kernel Newbies]     [PHP Database]     [Yosemite]

  Powered by Linux