PHP SOAP Extension Addition
July 11, 2005
I made a post a while back about the new PHP5 Soap Extension not supporting dynamic locations for web services. It appears to be fixed and in the 5.0.4 version.
You can now do something like:
The problem was that the soap ext looked in the wsdl file for the location of the web service. Well if you distributed your product or wanted to have a development location you had to maintain seperate wsdl files for each location. This fix addresses the problem and works just nicely. Thanks Andi!
You can now do something like:
<?php $client = new SoapClient("http://some.host.net/wsdl/somefile.wsdl",array("location" => 'myurl.com')); ?>
The problem was that the soap ext looked in the wsdl file for the location of the web service. Well if you distributed your product or wanted to have a development location you had to maintain seperate wsdl files for each location. This fix addresses the problem and works just nicely. Thanks Andi!
Eddie Peloke says:
July 11, 2005 @ 15:36 — Reply
Couldn't you do this before and not use wsdl? Just pass in a null and then pass in the info as the second param?
Jim says:
July 11, 2005 @ 15:46 — Reply
yep you could but realistically you're almost always using a WSDL file so to have to not use an available WSDL because of PHP's shortcoming was not ideal so you couldn't do $client->getAccount('jim'); you'd have to use __call and specify a bunch of other crap.
Eddie Peloke says:
July 11, 2005 @ 16:08 — Reply
Yeah and I think you have to bundle your params to each method as an array as the SOAP client didn't know how many params to expect for each method...right?.....yuk. That is the great thing about open source....bugs and features are added constantly and releases are often, no waiting indefinitely for the next version.
Stefan says:
November 11, 2006 @ 12:10 — Reply
Hello Jim, I am currently starting to learn SOAP with PHP. I am hitting lots of problems due to php caching of WSDL files. So every time I change the WSDL file, i have to copy them to new files. This really hinders trial and error approaches or learning. I already disabled caching within PHP. Do you mind helping me out a bit and doing an initial looking over my shoulders until I got started? My email is sb at bluhm-de dot com. This would be greatly appreciated. Best wishes, Stefan
Louis Vuitton handbags says:
June 16, 2010 @ 01:38 — Reply
Comment pending moderation