【问题标题】:unable to serialize the result error in nusoap webservicenusoap webservice中无法序列化结果错误
【发布时间】:2016-05-17 09:50:28
【问题描述】:

通过 nusoap webservice 插入新订单时出现以下错误

    <SOAP-ENV:Envelope SOAP-
 ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
       <SOAP-ENV:Body>
          <SOAP-ENV:Fault>
             <faultcode xsi:type="xsd:string">SOAP-ENV:Server</faultcode>
             <faultactor xsi:type="xsd:string"/>
             <faultstring xsi:type="xsd:string">unable to serialize result</faultstring>
             <detail xsi:type="xsd:string"/>
          </SOAP-ENV:Fault>
       </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>

请帮忙

【问题讨论】:

    标签: php web-services serialization wsdl nusoap


    【解决方案1】:

    错误说你的响应类没有序列化,它应该被序列化。

    尝试序列化您的响应类,然后重试。

    【讨论】:

      【解决方案2】:

      您应该在注册服务时设置返回类型,如以下示例:

      // registering login method in the wsdl
      $input_array = array('username' => "xsd:string", 'password' => "xsd:string"); // login parameters
      $return_array = array("return" => "xsd:string");
      $this->nusoap_server->register('login', $input_array, $return_array, "urn:SOAPServerWSDL", "urn:" . $this->ns . "/login", "rpc", "encoded", "Login to server services");
      

      在我的情况下,我将返回类型设置为字符串,我认为你应该这样做,

      【讨论】:

        猜你喜欢
        • 2017-02-13
        • 1970-01-01
        • 2018-07-23
        • 2011-03-18
        • 1970-01-01
        • 1970-01-01
        • 2015-09-07
        • 2022-12-09
        • 1970-01-01
        相关资源
        最近更新 更多