views:

392

answers:

4

Hello,

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 get:

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?

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

Thank you in advance,

Dave

A: 

The PHP source code (svn) which takes care of the import nodes contains the comment /* TODO: namespace ??? */. Namespaces are ignored which enables the method collisions to occur.

Three solutions are proposed:

  1. Fix the source code to cater for namespaces (which would be very welcome)
  2. Manipulate the WSDL files to prevent such method overlaps (this is likely not an option at all)
  3. Instead of using the original WSDL file, call the imported ones individually (or group ones which do not have method name collisions) with separate SoapClient instances.

Sorry that I can't be of more help.

salathe
A: 

Download a local copy of the WSDL file. Remove duplicate method names. Update your soap client to use the local WSDL file. This has worked well for me in the past.

Tim
A: 

Hello,

thank you for your answers!

to salathe:

1.) unfortunately this is not an option, since the soapclient will be used in a company project with low budget. fixing the source would be real fun, however i think i can't do this :/ sorry.

2.) the wsdl is being provided by someone else. changing the wsdls structure might be different in this case.

3.) splitting up the soap calls to different clients is also not possible.

to tim:

you think of an automated, soap client independant download and pre-processing of the wsdl? seems nice to me at first. However, the pre-processing might involve a lot of work.

thank you again for your answers. i'll keep you informed.

Dave

Dave
A: 

It seems nuSoap works perfectly fine for distributed wsdl files. But some problems still remain:

  • some calls are not conducted at all. i'm still investigating.
  • escaped body content is not display as charcater data .. (this would be useful sometimes)

cheers, dave

Dave