这是我的WSDL XML :(使用SoapUI生成)
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://soap.test.com/">
<soapenv:Header/>
<soapenv:Body>
<ser:myMethod>
<user>
<id>?</id>
<name>?</name>
</user>
<code>?</code>
</ser:myMethod>
</soapenv:Body>
</soapenv:Envelope>
我的PHP代码使用“ myMethod ”方法:
$opts = array(
'location' => 'http://example.com/myServices?WSDL',
'uri' => 'http://soap.test.com'
);
$client = new SOAPClient(null, $opts);
$res = $client->__soapCall('myMethod', array(
"id" => "123",
"name" => "Sam"
));
var_dump($res);
我收到Cannot find dispatch method for {http://soap.test.com} myMethod
错误。
我已经使用SoupUI测试了SOAP并且它已经正确响应。
这里有什么问题?