douchu5131 2014-05-26 09:36
浏览 68
已采纳

PHP NuSOAP响应

Is it normal that the response of the nusoap server is like this?

If not, how do i fix or remove the &lt and &gt and make it as < and >

<?xml version="1.0" encoding="utf-8"?>
<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><ns1:get_stocksResponse xmlns:ns1="VSR"><return xsi:type="xsd:string">&lt;facilitator&gt;
&lt;stock_response&gt;
    &lt;product&gt;
      &lt;productid&gt;1072722&lt;/productid&gt;
      &lt;voorraad&gt;888040&lt;/voorraad&gt;
    &lt;/product&gt;
    &lt;product&gt;
      &lt;productid&gt;1072724&lt;/productid&gt;
      &lt;voorraad&gt;888603&lt;/voorraad&gt;
    &lt;/product&gt;
&lt;/stock_response&gt;
&lt;/facilitator&gt;
</return></ns1:get_stocksResponse></SOAP-ENV:Body></SOAP-ENV:Envelope></code>

this is my register function in the server

$this->server->register('get_stocks',                // method name
        array('product' => 'xsd:int'),        // input parameters
        array('return' => 'xsd:string'),      // output parameters
        $this->_namespace,                      // namespace
        'urn:'.$this->_namespace.'#get_stocks',                // soapaction
        'rpc',                                // style
        'encoded',                            // use
        'Get stocks of products'            // documentation
    ); 

and this is my return function

$xmlDoc = new DOMDocument('1.0', 'utf-8');
$xmlDoc->formatOutput = TRUE;
...etc
$nodes = $xmlDoc -> getElementsByTagName ('facilitator');
$node = $nodes -> item(0);

return $xmlDoc->saveXML($node);
  • 写回答

2条回答 默认 最新

  • doulianxi0587 2014-05-27 07:56
    关注

    from this Nusoap use existing WSDL how to?

    i found this

    var $methodreturnisliteralxml = false;
    

    and just set it to true upon creating the nusoap server

    $this->server->methodreturnisliteralxml = true;
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题
  • ¥15 Visual Studio问题
  • ¥20 求一个html代码,有偿
  • ¥100 关于使用MATLAB中copularnd函数的问题