开发者

PHP Soap Header help

I have a fairly simple php/soap header question.

Here's what I need.

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

Here's what I get...

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

using this code...

$headers[] = new S开发者_Go百科oapHeader('http://qpricer.com/Services/Pricing','Identity',array('token'=> '123456789'));
$client->__setSoapHeaders($headers);

Using soapui, I have narrowed my issue down to this right here.

How do I go from the second one to the first one?

An help would be greatly appreciated, thanks for your time.


Because this was the only header I had to set, I was able to fix it using the following code.

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

This produced the following XML

<ns1:Identity token="123456789"/>

and it worked!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜