Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP SoapClient: Problems with Distributed WSDL File

I have a problem using a distributed WSDL File (scheme / other definitions are declared outside the actual WSDL) with PHP's SoapClient.

This is the fault message I got:

SOAP-ERROR: Parsing WSDL:  'getSomeInfo' already defined.

After some googling, it seems to be a bug inside PHP as someone else discovered exactly the same problem: http://bugs.php.net/bug.php?id=45282

Has there been any bug fix(es)? Any solution to work around this bug?

I think posting a code snippet is senseless, since the invocation of the SoapClient ctor using just the WSDL is the only that fails.

like image 893
Dave Avatar asked Nov 06 '22 16:11

Dave


1 Answers

I had same issue. The problem was in wsdl and imports, I saved wsdl from site and pointed soapclient to use local file, but all references were original. Soap client each time gets file from remote host, went to parts, and from them back to same file but on remote drive. That caused same file to be loaded twice. Solution is to use only remote files or to rewrite paths to local (all). SoapUI does that when you hit "export definitions" on project wsdl. Hope that will help others.

like image 51
DMC Avatar answered Nov 14 '22 23:11

DMC