SV: SV: Read the SOAP return

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

 



Hi Rob,

Thank you for your answer. It make sense to me. I'll try what you suggest.

I work with PHP5 so maybe there is an easier way to do the job.



Regards / Med venlig hilsen

Jeppe Donslund
Programmør

Tlf. dir. 7633 8824

Webmasters
Agtrupvej 51
6000 Kolding

Tlf. 7550 8877
jd@webmasters.dk
www.webmasters.dk

 
 

-----Oprindelig meddelelse-----
Fra: Rob [mailto:rrichards@ctindustries.net] 
Sendt: 25. april 2007 12:22
Til: Jeppe Donslund
Cc: soap@lists.php.net
Emne: Re: SV: Read the SOAP return

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