0
我想生成以下SOAP頭格式,基於PHP的SOAP頭文件如何生成特定的格式?
<soapenv:Header>
<SoapHeaderMsg xmlns="http://xyz.com.au">
<opt:UserSoapHeader>
<opt:IdentityName>TEST</opt:IdentityName>
<opt:AuthenticationToken>jjjkjkjkjkjkj</opt:AuthenticationToken>
</opt:UserSoapHeader>
</SoapHeaderMsg>
</soapenv:Header>
所以我用下面的PHP函數生成此,
$this->__setSoapHeaders(array(
new SoapHeader('http://xyz.com.au', 'SoapHeaderMsg', array(
new SoapHeader('http://xyz.com.au', 'IdentityName', 'TEST'),
new SoapHeader('http://xyz.com.au', 'AuthenticationToken', 'jkjkjkk')
)),
));
產生以下標題這是完全不同的,以我想要的以上 ?我如何使用上面的PHP函數生成完全相同的頭文件?
<SOAP-ENV:Header>
<ns1:SoapHeaderMsg>
<SOAP-ENC:Struct>
<namespace>http://xyz.com.au</namespace>
<name>IdentityName</name>
<data>TEST</data>
<mustUnderstand>false</mustUnderstand>
</SOAP-ENC:Struct>
<SOAP-ENC:Struct>
<namespace>http://xyz.com.au</namespace>
<name>AuthenticationToken</name>
<data>hjhhjjhjhjhj</data>
<mustUnderstand>false</mustUnderstand>
</SOAP-ENC:Struct>
</ns1:SoapHeaderMsg>
</SOAP-ENV:Header>