WSDL
我以这种方式向服务器发送请求:
$soap = new SoapClient('WSDL_URI');
$soap->SomeFunction(array('Param1' => 123, 'Param2' => 456));
它工作正常,并__getLastRequest
返回:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://tempuri.org/">
<SOAP-ENV:Body>
<ns1:SomeFunction>
<ns1:Param1>123</ns1:Param1>
<ns1:Param2>456</ns1:Param2>
</ns1:SomeFunction>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
但是如果我调用SomeFunction
by __soapCall
,WSDL
服务器会停止并且不会返回正确的响应。
$soap->__soapCall('SomeFunction', array('Param1' => 123, 'Param2' => 456));
__getLastRequest
返回:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://tempuri.org/">
<SOAP-ENV:Body>
<ns1:SomeFunction/>
<param1>123</param1>
<param2>456</param2>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
你看,因为请求不同,它不起作用..
如何解决?