2010-08-09 102 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"/> 

和它的工作!