douchensou6969 2012-07-10 16:29
浏览 41

处理PHP SoapServer头时,没有数据传入头函数

My header method (AuthHeader) is being called on the server side but the param value is an object and prints out as '1'. I am expecting a 'ticket' string (as in $header->ticket) as defined in the wsdl below.

public function AuthHeader($header)
{
    try {
        error_log(print_r($header));
        ...

wsdl definition...

        <element name="AuthHeader">
            <complexType>
                <sequence>
                    <element name="ticket" type="xsd:string"/>
                </sequence>
            </complexType>
        </element>

I think I have everything setup correctly and dumping the incoming request shows that the header is correct.

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.example.com/SOAP/"><SOAP-ENV:Header><ns1:AuthHeader><ns1:ticket>myticketval</ns1:ticket></ns1:AuthHeader></SOAP-ENV:Header><SOAP-ENV:Body>...

What am I doing wrong?

  • 写回答

1条回答 默认 最新

  • duanchazhou6779 2012-07-10 16:43
    关注

    Try casting the object as a string. I have had to do that in the past with SimpleXML objects, and it may be the same in your case.

    print (string)$header;
    
    评论

报告相同问题?

悬赏问题

  • ¥15 BP神经网络控制倒立摆
  • ¥20 要这个数学建模编程的代码 并且能完整允许出来结果 完整的过程和数据的结果
  • ¥15 html5+css和javascript有人可以帮吗?图片要怎么插入代码里面啊
  • ¥30 Unity接入微信SDK 无法开启摄像头
  • ¥20 有偿 写代码 要用特定的软件anaconda 里的jvpyter 用python3写
  • ¥20 cad图纸,chx-3六轴码垛机器人
  • ¥15 移动摄像头专网需要解vlan
  • ¥20 access多表提取相同字段数据并合并
  • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角
  • ¥20 Java-Oj-桌布的计算