PHP5 SOAP Error in non-WSDL Mode

I just came across a really strange error while using PHP5’s excellent SOAP functionality. My SoapClient was operating in non-WSDL mode but when I called function that did not exist I got the error:

Operation 'getFunctions' is not defined in the WSDL for this service

After spending quite a long time trying to get the client to realise it wasn’t supposed to be using a WSDL, I realised I had mistyped the name of the function and what the error message actually meant was “this function does not exist”. Hopefully I’ll remember next time I see the same problem, hopefully by putting it here it might also help someone else too.

5 thoughts on “PHP5 SOAP Error in non-WSDL Mode

  1. The sure way to avoid typo related problems like this is use copy and paste.

    Does that error originate in PHP, or come back from the SOAP server? Perhaps inspecting the SOAP response may have given a better error.

  2. Simon: I think it might be nusoap’s fault rather than PHP’s fault, but its still a rather misleading message.

    Geoff: vim users don’t mess about with copy and paste, that’s for slow mouse-using people :) That is the message component of the SoapFault object that was returned by the remote service, observed on the client end.

    • I also prefer a keyboard to a mouse, so copy and paste using keys (whether in Vim or not).

      Do you think you might get the same error message, if you were to consume the SOAP service with a non PHP client?

      • its the drag-to-select that is a killer rather than the actual clicking to copy :)

        I am fairly certain I’d get the same error with another SOAP client since the SOAP fault is returned by the server. I’d be happy to be told otherwise however

Leave a Reply

Please use [code] and [/code] around any source code you wish to share.

This site uses Akismet to reduce spam. Learn how your comment data is processed.