|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull Requests |
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 07 08:00:02 2025 UTC |
Description: ------------ function function1() { return new SoapVar("some text",XSD_STRING); } function function2() { return new SoapVar("<tag>some text</tag>",XSD_ANYXML); } $soapserver = new SoapServer("mywsdl.wsdl"); $soapserver->addFunction("function1"); $soapserver->addFunction("function2"); $soapserver->handle(); Requesting function1 will produce <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="myns"> <SOAP-ENV:Body> <ns1:function1Response>some text</ns1:function1Response> </SOAP-ENV:Body> </SOAP-ENV:Envelope> but requesting function2 will produce <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="myns"> <SOAP-ENV:Body> <tag>some text</tag> </SOAP-ENV:Body> </SOAP-ENV:Envelope> The method name response tags are missing here. The Body-part should be <ns1:function2Response> <tag>some text</tag> </ns1:function2Response> Response-tags should come from WSDL as with function1. This behaviour is also demostrated in http://www.herongyang.com/WSDL/PHP-SOAP-XSD_ANYXML-Build-SOAP-Body-Element.html