tags:

views:

148

answers:

1

I'm trying to get PHP connecting correctly to a WSDL using SoapClient, it connects (as in finds the WSDL) okay but then gives me the following error:

Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Missing name for <fault> of 'invokeService'

The PHP code is as follows:

$client = new SoapClient("wsdl.wsdl");

And the XML in the WSDL file where it's failing is as follows:

  <portType name="invokePort"> 
    <operation name="invokeService"> 
      <input message="wsdlns:invokeRequest"/> 
      <output message="wsdlns:invokeResponse"/> 
      <fault message="soap:fault"></fault> 
    </operation> 
  </portType> 

Any idea what's wrong?

Thanks

+1  A: 

Well, Missing name for <fault> sounds quite self-explanatory. Did you try to add an attribute "name" to the fault element?

UPDATE: Regarding to the Missing <message> with name 'soap:fault' error, you can try the following:

<message name="MyFaultName"/>
<portType>
    <!-- ... -->
    <fault name="MyFaultName">
        <soap:fault name="MyFaultName" use="literal"/>
    <fault>
</portType>

Not sure it won't further complain of other issues, though. Manually creating WSDLs is a real pain, I'd recommend you look for some tool that generates it for you from the source code.

nuqqsa
Thanks for your response. When adding a name of fault to the fault tag, it then gives the following error:Missing <message> with name 'soap:fault'
Probocop
Please see updated answer.
nuqqsa