PHP Soap Error - Procedure 'xxx' not present

In PHP while using SOAP extension and calling external service, you might get into problem that PHP keeps on saying that method does not exist.
You are calling a method on a service that has the method and you are still getting "Procedure 'xxx' not present" error.
Error would look more or less like this:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
   <SOAP-ENV:Body>
      <SOAP-ENV:Fault>
         <faultcode>SOAP-ENV:Server</faultcode>
         <faultstring>Procedure 'gettwotandomitems' not present</faultstring>
      </SOAP-ENV:Fault>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

To fix that problem you can try to remove all files in the temporary folder for you WSDL cache. You can double check in phpinfo where
does your PHP keep these WSDL files.

Delete all /tmp/wsdl* (or whereever your PHP keeps them). Then try to execute the soap call again. It should work this time : -)

Hope it helps someone.

Comments

$server = new

$server = new SoapServer("soapservice.wsdl", array('cache_wsdl' => WSDL_CACHE_NONE));

2016-01-11 04:50
Abdul Basit Nawab

You're a life saver.

You're a life saver. Thanks.

This had no effect:
$client = new \SoapClient('URL', ['cache_wsdl' => WSDL_CACHE_NONE]);

2014-10-29 14:37

It helps!

It helps!

2013-11-18 03:05
Paul

Thankyou for the tip! This

Thankyou for the tip! This can't be emphasized enough - I just wasted an hour on this issue before seeing this.

It appears that, for me at least, setting:

ini_set("soap.wsdl_cache_enabled", 0);

on the server-side has no effect (a bug?). It wasn't until I removed the WSDL cache files from /tmp that things started working as expected.

2012-12-14 02:42
Ian

thank you for your share ~ It

thank you for your share ~
It helps us to fix our problem. Thanks again ^^

2012-08-13 01:59
FromTaiwan

Post new comment

Image CAPTCHA

About the author

Artur Ejsmont

Hi, my name is Artur Ejsmont,
welcome to my blog. I am a passionate software engineer living in Sydney and working for Yahoo!

Web Scalability for Startup Engineers

If you are into technology, you can order my book Web Scalability for Startup Engineers on Amazon. I would love to hear what are your thoughts so please feel free to drop me a line or leave a comment.

Follow my RSS