PHP SoapFault:getCode = 0和getMessage =错误版本

时间:2019-02-19 14:10:16

标签: php wsdl

我从WSDL文件生成了所需的类。当我调用网络服务时,其返回码为0,消息为“错误版本”

 try {
        self::setSoapHeaderSendSms(new RequestSOAPHeader(Config::get('USER'), Config::get('PASS'), Config::get('SERVICE_ID')));

        return $this->setResult(self::getSoapClient()->SendSms($_rightelSmsStructSendSms));
    } catch (SoapFault $soapFault) {
        echo $soapFault->getCode() . ": " . $soapFault->getMessage();
    }

出什么问题了?

这是我的请求(从__getLastRequest()获取):

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://rightel.ir/webservices/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><SOAP-ENV:Header><ns1:Header><username>myuser</username><password>mypass</password><serviceid>myservice</serviceid><result/><lastError/><internArrayToIterate/><internArrayToIterateIsArray/><internArrayToIterateOffset/></ns1:Header></SOAP-ENV:Header><SOAP-ENV:Body><ns1:SendSms><ns1:endUserId>userid</ns1:endUserId><ns1:senderCode>mysendercode</ns1:senderCode><ns1:message>Test</ns1:message></ns1:SendSms></SOAP-ENV:Body></SOAP-ENV:Envelope>

我在WSDL构造函数中被设置为SOAP_1_1或SOAP_1_2,但没有任何改变!

0 个答案:

没有答案