logo       

Re: Problem with SOAP envelope?: msg#00091

php.nusoap.general

Subject: Re: Problem with SOAP envelope?

>>>>
What I'm finding now is that for some reason, the soap_server::service()
function is turning the XML into an array prior to passing it to my
registered function, which is expecting it to be in XML format. The
data is in XML format when submitted to the NuSOAP server by
a NuSOAP client, but for some reason it's transforming it into an
array when submitted via HTTP post.
<<<<

SOAP was originally created as, basically, a multi-platform remote procedure
call specification, leveraging existing specifications like XML and HTTP. The
benefit of NuSOAP, as well as other SOAP implementations, is to provide a
programming model similar to a normal function call. This should allow
programmers using NuSOAP to use SOAP for remote procedure calls without
touching protocols like HTTP and encodings like XML, and that is exactly how
most programmers use NuSOAP.

WSDL 1.1 formally introduced the notion of using SOAP to transport arbitrary
XML. Programmers who were interested in using this document-based model
leveraged the protocol portion of the SOAP infrastructure (and get the benefits
of add-on specs for SOAP security, etc.), but were left to work with the XML
directly in their own code.

NuSOAP has only limited abilities to work in the document-based SOAP world. As
you have discovered, for example, the server is more-or-less forced into the
RPC model, in that the incoming SOAP payload is parsed into parameters to pass
to the function handling a call. Programmers who want to access the raw XML
for the request must use the requestSOAP property of soap_server, like this

$server = new soap_server;
...
function method1($x) {
global $server;

$xml = $server->requestSOAP;
// parse document from SOAP request
...
}

Of course, in such a case, NuSOAP is not really doing much of anything for you,
except eating memory and CPU cycles, since your code could just access
$HTTP_RAW_POST_DATA directly.

Scott Nichol

Do not send e-mail directly to this e-mail address,
because it is filtered to accept only mail from
specific mail lists.




-------------------------------------------------------
This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek
For a limited time only, get FREE Ground shipping on all orders of $35
or more. Hurry up and shop folks, this offer expires April 30th!
http://www.thinkgeek.com/freeshipping/?cpg297


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise