How to control that namespace (before colon) part of SoapHeader?
Specification: Add a new header to an existing integration. The header should look like this:
<soapenv:Header>
<soapenv:signature>{$some_data}</soapenv:signature>
</soapenv:Header>
My naïve implementation:
$signature_header = new SoapHeader('soapenv', 'signature', $signature);
$SOAP->__setSoapHeaders($signature_header);
The result:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="http://corpwsdl2.oneninetwo"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ns2="soapenv"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>
<SOAP-ENV:Header>
<ns2:signature>…</ns2:signature>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
…
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
I.e., I get: - <SOAP-ENV:Header>, instead of expected <soapenv:Header> - <ns2:signature>, instead of <soapenv:signature>
Is there a way to control that "before colon" parts of generated tags?
<soapenv:Header>
<soapenv:signature>{$some_data}</soapenv:signature>
</soapenv:Header>
My naïve implementation:
$signature_header = new SoapHeader('soapenv', 'signature', $signature);
$SOAP->__setSoapHeaders($signature_header);
The result:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="http://corpwsdl2.oneninetwo"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ns2="soapenv"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>
<SOAP-ENV:Header>
<ns2:signature>…</ns2:signature>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
…
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
I.e., I get: - <SOAP-ENV:Header>, instead of expected <soapenv:Header> - <ns2:signature>, instead of <soapenv:signature>
Is there a way to control that "before colon" parts of generated tags?
Комментарии
Отправить комментарий