I am desperate. I am trying to call soap request from php like this xml
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"xmlns:hot="http://hotelconcepts.com/"> <soapenv:Header>
<hot:Authentication>
<!--Optional:-->
<hot:User>?</hot:User>
<!--Optional:-->
<hot:Password>?</hot:Password>
<!--Optional:-->
<hot:CrsProperty>?</hot:CrsProperty>
<!--Optional:-->
<hot:VendorId>?</hot:VendorId>
<!--Optional:-->
<hot:Version>?</hot:Version>
</hot:Authentication>
</soapenv:Header>
<soapenv:Body>
<hot:CwiPackageAvailabilityDetails>
<!--Optional:-->
<hot:PropertyCode>?</hot:PropertyCode>
<!--Optional:-->
<hot:Packages>
<!--Zero or more repetitions:-->
<hot:string>?</hot:string>
</hot:Packages>
<hot:StartDate>?</hot:StartDate>
<hot:EndDate>?</hot:EndDate>
<!--Optional:-->
<hot:Adults>0</hot:Adults>
<!--Optional:-->
<hot:Children>0</hot:Children>
<!--Optional:-->
<hot:Infants>0</hot:Infants>
<!--Optional:-->
<hot:Nights>0</hot:Nights>
</hot:CwiPackageAvailabilityDetails>
I am trying something like this, but i don´t know how to imitate this xml request by php soap client.
$client = new SoapClient($this->wsdl);
$headers = array(
"Authentication" => array(
"User" => $this->user,
"Password" => $this->pass,
"CrsProperty" => $this->crsProperty
)
);
$client->__setSoapHeaders($headers);
/* Set your parameters for the request */
$params = array(
"User" => $this->user,
"Password" => $this->pass,
"CrsProperty" => $this->crsProperty,
"PropertyCode" => $this->propertyCode,
"StartDate" => $startDate,
"EndDate" => $endDate,
"Adults" => $adults,
"Children" => $children,
);
try {
/* Invoke webservice method with your parameters, in this case: Function1 */
$response = $client->__soapCall("CwiPackageAvailabilityDetails", array($params, $headers));
} catch (\Exception $e) {
echo $e->getMessage();
}
echo "REQUEST:
" . $client->__getLastRequest() . "
";
/* Print webservice response */
var_dump($response);
}
But i get only this message: Server was unable to process request. ---> Not authenticated for property
Thank you for any help