2

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 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

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'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.