Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uncaught SoapFault exception: [Client] Function is not a valid method for this service

Tags:

php

soap

wsdl

When I try to access a function in wsdl with some data(using soap client in php) I am getting the following error.

Uncaught SoapFault exception: [Client] Function function_nameis not a valid method for this service

Any help?

like image 386
ravikiran reddy Avatar asked Dec 02 '11 10:12

ravikiran reddy


3 Answers

If you want to execute a function that SOAP can not find - it is possible that PHP cached the wsdl file.

Add this:

ini_set("soap.wsdl_cache_enabled", "0");

to disable the caching.

like image 90
biphobe Avatar answered Oct 30 '22 14:10

biphobe


Two possible solutions :

  1. try to see if the function really exists with the snippet of code there : PHP SoapClient request: not a valid method for this service
  2. Also, once you have displayed the list of available function calls, take care that if your WSDL is generated by a Java SOAP server, you might have several functions named "service" (or with the same name). Only the first one will be recognized and used by the PHP SOAP client. You need to manually rename all your in the WSDL !
like image 33
spiritoo Avatar answered Oct 30 '22 14:10

spiritoo


I had this problem and finally decided to check my php error log.

In php.ini enable always_populate_raw_post_data = -1 and restart the server .

My PHP version is 5.6.8

like image 32
Leandro Oliveira Avatar answered Oct 30 '22 14:10

Leandro Oliveira