is it possible, using PHP SoapServer class, to stream data back to the client along the computation?
i know this is possible using ASP.NET
http://msdn.microsoft.com/en-us/library/aa528818.aspx
if not, is it possible to implement it? as far as i understand the php soap facilities, they only allow my functions to return a big chunk of data, and once completed the library will convert it in a big soap message… :-/
thanks in advance 🙂
The short answer is that this is not possible with the SoapServer class.
The current implementation builds the resulting XML document as it checks parameters for validity (to make sure you’re not sending crazy invalid SOAP parameters).
While it may be possible to implement what you’re asking in the extension, I would be a significant change, as it would have to loop twice over the parameters, once to check for validity (so they can throw a Soap Fault), and then a second time to serialize to the client.
It is also possible to implement this in userland in your PHP script, but this would require you to serialize all of you response data by hand (since the builtin class does not expose this functionality to you). This is not a bad option if you control both sides of the request (client and server), and don’t need to take advantage of any “advanced” soap features the server library provides.
For this you would just send a standard soap XML header, then loop over your data converting it to XML as you write it directly to the client.