无法在PHP Soap Clinet中发送CDATA

时间:2019-01-21 12:19:27

标签: php soap

我正在发送肥皂请求,并且也从服务器获得正确的响应。但无法将CDATA作为字符串发送。方法类型是对象和字符串

class clsSecurity {
public function __construct() 
{
    $this->fullname= 'fullname';
    $this->username = 'username';
    $this->password = 'password';
    $this->ip = 'XX.XX.XX.XX';
    $this->request = 'XXX';
}

}

$client = new SoapClient("http://wsdlurl?WSDL",['trace' => 1]);
$contact = new clsSecurity();


 $par = "<![CDATA[<Availability>
<seat>D</seat>
<room>O</room>
<access>N</access>
</Availability>]]>";

$params = array(
  'objSecurity' => $contact,
'avalibility'=>$par
);
$response = $client->__soapCall("roomAvailability", array($params));
echo "<>" . $client->__getLastRequest() . "<>";

我无法将availability作为字符串发送,第一个参数应该是obj,第二个参数应该是字符串。 在$clinet->__getType();

之后
Availability { clsSecurity objSecurity; string roomAvailability; }

0 个答案:

没有答案