规范:向现有集成添加新的标头。标头应如下所示:
<soapenv:Header>
<soapenv:signature>{$some_data}</soapenv:signature>
</soapenv:Header>
我天真的实现方式
$signature_header = new SoapHeader('soapenv', 'signature', $signature);
$SOAP->__setSoapHeaders($signature_header);
结果:
<?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>
即,我得到:
-<SOAP-ENV:Header>
,而不是预期的<soapenv:Header>
-<ns2:signature>
,而不是<soapenv:signature>
是否有一种方法可以控制生成的标记的“冒号之前”部分?