note 79642 added to ref.soap
| From: | EmanueleColonnelli at osu1 dot php dot net | Date: | Thu, 06 Dec 2007 13:24:42 +0000 |
| Subject: | note 79642 added to ref.soap | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-132888@lists.php.net to get a copy of this message | ||
Hi,
I'd like to add this trick to get SoapClient correctly running with a WSDD-generated Axis 1
webservice.
By default, Apache Axis 1 generates a SOAP RPC/Encoded WSDL with "urn:" prefixes before
all <SERVICE_NAME> occurrences.
Axis 1 WSDL also uses an "impl:" namespace prefix.
Suppose your service's name is "myWS", your WSDL will contains a
"<wsdl:binding>" element with the name attribute valued
"urn:myWSSoapBinding":
<wsdl:binding name="myWSSoapBinding">
PHP SoapClient has a problem (I hope it will be fixed soon ) parsing this WSDL and generates this
error:
SOAP-ERROR: Parsing WSDL: No element with name 'myWSSoapBinding'
This error arise because PHP SoapClient could not resolve the "urn:impl:myWSSoapBinding"
QName in generated WSDL:
<wsdl:service name="myWSService">
<wsdl:port binding="impl:urn:myWSSoapBinding" name="urn:myWS">
<wsdlsoap:address location="http://URL/services/urn:myWS"/>
</wsdl:port>
</wsdl:service>
To solve this problem I parse WSDL applying a preg_replace to delete all "urn:"
occurrences.
Then I save this generated WSDL somewhere in my site and point my SoapClient to this location.
I also need to specify additional parameters to SoapClient constructor:
<?php
$soap = new SoapClient("wsdl/myWS.wsdl",
array(
"style" => SOAP_RPC,
"use" => SOAP_ENCODED,
"soap_version" => SOAP_1_1,
"uri"=>"urn:myWS"
));
?>
I suggest you this resources to a full understanding of this kind of problems:
http://www.ibm.com/developerworks/
webservices/library/ws-whichwsdl/
http://wso2.org/wiki/display/wsfphp/
PHP+SOAP+Extension+API+-+Backward+Compatibility
I hope this save you hours of imprecations! :)
Emanuele Colonnelli
----
Server IP: 213.92.11.19
Probable Submitter: 194.184.159.5
----
Manual Page -- http://www.php.net/manual/en/ref.soap.php
Edit -- https://master.php.net/note/edit/79642
Del: integrated -- https://master.php.net/note/delete/79642/integrated
Del: useless -- https://master.php.net/note/delete/79642/useless
Del: bad code -- https://master.php.net/note/delete/79642/bad+code
Del: spam -- https://master.php.net/note/delete/79642/spam
Del: non-english -- https://master.php.net/note/delete/79642/non-english
Del: in docs -- https://master.php.net/note/delete/79642/in+docs
Del: other reasons-- https://master.php.net/note/delete/79642
Reject -- https://master.php.net/note/reject/79642
Search -- https://master.php.net/manage/user-notes.php