我尝试使用SOAP并连接到WSDL文件。我不知道为什么要发送10个请求,但其他给我错误的版本错误。我通过
在呼叫肥皂中定义了版本'soap_version'=> SOAP_1_1,
WSDL从此开始:
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://tempuri.org/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
错误向我显示这样:
"message": "Wrong Version",
"status_code": 500,
最后我找到了原因。
在我的代码中,我使用了这样的旧版本:
$result = $this->serve()->__soapCall($functionName, $arguments);
protected function serve()
{
if (is_null($this->client))
{
$this->client = new SoapClient($this->wsdl, $this->options);
}
return $this->client;
}
然后,当我更改此问题时,请解决:
$sms_client = new SoapClient($this->wsdl, array('encoding'=>'UTF-8'));
$result = $sms_client->$functionName($arguments);