Answer the question
In order to leave comments, you need to log in
How to correctly set the authentication token for a SOAP request?
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" >
<soapenv:Header>
<urn:OTAuthentication>
<!--Optional:-->
<urn:AuthenticationToken></urn:AuthenticationToken>
</urn:OTAuthentication>
</soapenv:Header>
<soapenv:Body>
<urn1:GetNodes>
<!--Zero or more repetitions:-->
<urn1:IDs>2005</urn1:IDs>
</urn1:GetNodes>
</soapenv:Body>
</soapenv:Envelope>
<soapenv:Header>
<urn:OTAuthentication>
<!--Optional:-->
<urn:AuthenticationToken></urn:AuthenticationToken>
</urn:OTAuthentication>
</soapenv:Header>
Answer the question
In order to leave comments, you need to log in
Class/stub for token
class Token {
public $id;
public function __construct($id) {
$this->id = $id;
}
}
Here is how I managed to solve it
$strHeaderComponent_Session = "<ns2:PRostranstvo><ns2:AuthenticationToken>$token</ns2:AuthenticationToken></ns2:PRostranstvo>";
$objVar_Session_Inside = new SoapVar($strHeaderComponent_Session, XSD_ANYXML, null, null, null);
$objHeader_Session_Outside = new SoapHeader('urn:burum burum', 'PRostranstvo', $objVar_Session_Inside);
$this->client->__setSoapHeaders([$objHeader_Session_Outside]);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question