肥皂;MissingId“;使用PHP SOAPCLIENT
出于某种原因,我从肥皂中得到:肥皂;MissingId“;使用PHP SOAPCLIENT,php,soap,soap-client,Php,Soap,Soap Client,出于某种原因,我从肥皂中得到: [Code] => SessionIdMissing [Description] => Session Id Missing 这是我需要发送的原始XML: <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/20
[Code] => SessionIdMissing
[Description] => Session Id Missing
这是我需要发送的原始XML:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Header>
<SessionIdHeader xmlns="http://www.ws.com/webservices/v2">
<SessionId>ef7b1728ce004a4dbd7404d16918dd53</SessionId>
<EndSession>true</EndSession>
</SessionIdHeader>
</soap:Header>
<soap:Body>
<Send xmlns="http://www.ws.com/webservices/v2">
<source xsi:type="ExistingSendingSource">
<ChannelType>Sms</ChannelType>
<Id>1</Id>
</source>
<target xsi:type="ExistingRecipientSendingTarget">
<RecipientId>12070135</RecipientId>
<ExternalGroupId xsi:nil="true" />
</target>
</Send>
</soap:Body>
任何建议?string(32)“c149327c8d2e417a99959638f1200dde”都可以,但仍然会丢失ID,我不知道为什么..您可以检查的内容,看看是否正确发送了原始XML?这是我得到的:Null只有将
trace
选项传递给客户端构造函数时,上述选项才会起作用,根据手册页面:$c=newsoapclient($url,array('trace'=>true))代码>
$paramsSend = array(
'SessionId' => $SessionId,
'Body'=>'This is a test message',
'Name'=>'Test Message',
'Sender'=>'7777',
'Charset' => 'UTF-8',
'MobileNumber'=>'4646546546'
);
if (!$url) $url = 'https://www.someservice.com/ws/smsservice.asmx?WSDL';
$c = new SoapClient($url);
$res= $c->__call($module, array($params));