Я пытаюсь установить заголовок Soap для WSDL и задаюсь вопросом, правильный ли следующий код.
Я пытаюсь передать все 3 переменные в заголовок Soap.
Любой указатель был бы очень признателен.
Спасибо
КОД PHP:
try{
$soap_client = new SoapClient('https://mywebservice.com/ws.php?wsdl');
//Body of the Soap Header.
$soapheader = $this->getMRSoapHeader("PortalOnlineInventorySearch");
$headerbody = array('Timestamp' => $soapheader['Timestamp'],
'Signature' => $soapheader['Signature'],
'AccessID' => $soapheader['AccessID']);
//Create Soap Header.
$header = new SOAPHeader($this->ns, 'WebServiceSoapHeader', $headerbody);
//set the Headers of Soap Client.
$soap_client->__setSoapHeaders($header);
$searchResult = $soap_client->PortalOnlineInventorySearch($meetingRoomOnlineSearchCriteria);
}catch (Exception $e){
error_log("Error getting Search Results from Titan" + $e->getMessage());
var_dump("Error performing criteria search" . $e->getMessage());
}
WSDL:
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Header>
<WebServiceSoapHeader xmlns="https://mywebservice.com/ws.php?wsdl">
<Signature>string</Signature>
<AccessID>string</AccessID>
<Timestamp>string</Timestamp>
</WebServiceSoapHeader>
</soap12:Header>
<soap12:Body>
<PortalOnlineInventorySearch xmlns="https://mywebservice.com/ws.php">
<searchCriteria>
<keyword>int</keyword>
<ReturnServices>boolean</ReturnServices>
</searchCriteria>
</PortalOnlineInventorySearch>
</soap12:Body>
</soap12:Envelope>