2010-08-09 105 views
6

我有一个相当简单的php/soap标题问题。PHP Soap Header帮助

这是我需要的。

<ns1:Identity token="123456789"></ns1:Identity> 

这里就是我得到...

<ns1:Identity><item><key>token</key><value>123456789</value></item></ns1:Identity> 

使用此代码...

$headers[] = new SoapHeader('http://qpricer.com/Services/Pricing','Identity',array('token'=> '123456789')); 
$client->__setSoapHeaders($headers); 

使用的soapUI,我已经缩小我的问题到这一权利在这里。

我该如何从第二个到第一个?

一个帮助将不胜感激,谢谢你的时间。

回答

2

因为这是我必须设置的唯一标头,所以我能够使用以下代码修复它。

$headers[] = new SoapHeader('http://www.qpricer.com/Services/Pricing','Identity token="123456789"',null); 

这产生了以下XML

<ns1:Identity token="123456789"/> 

和它的工作!