duanhe1976 2010-07-21 02:13
浏览 125

在nusoap中传递一个xml

Good day,

I am having trouble passing an xml in nusoap.

sample: I pass this xml

<test>123</test>

The nusoap response is

test123/test

The greater than and less than sign is removed.

This is my code for the server:


require_once('nusoap/nusoap.php');
$server = new nusoap_server; // Create server instance

$server->configureWSDL('demows','http://example.org/demo');

$server->register('myFunction',
    array("param"=>"xsd:string"), // input
    array("result"=>"xsd:string"), // output
    'http://example.org/demo'
);

function myFunction($parameters) {
    return $parameters;
}

// Use the request to try to invoke the service
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA: '';
$server->service($HTTP_RAW_POST_DATA);

This is my code for the client:


require_once('nusoap/nusoap.php');

$client = new nusoap_client('http://localhost/nusoap/ws.php?wsdl', true);

$clientparam = '<test>123</test>';

$result = $client->call('myFunction', 
    array('param'=>$clientparam)
);

print_r($result);

*Note that the above code is working on PHP Version 5.3.0 but NOT on PHP Version 5.2.0-8+etch13 which is the one on our production is using.

I've searched the net for any issues on the 2 version but none found. Any help is highly appreciated. TIA

  • 写回答

5条回答 默认 最新

  • dongxiang3648 2010-07-21 13:53
    关注

    I don't know nusoap at all, but it sounds like your entities are being discarded. It might be worth controlling the entities at either end, for instance by changing '>' for &gt;, '<' for &lt; either manually or using a function such as htmlentities()

    评论

报告相同问题?

悬赏问题

  • ¥15 多址通信方式的抗噪声性能和系统容量对比
  • ¥15 winform的chart曲线生成时有凸起
  • ¥15 msix packaging tool打包问题
  • ¥15 finalshell节点的搭建代码和那个端口代码教程
  • ¥15 用hfss做微带贴片阵列天线的时候分析设置有问题
  • ¥15 Centos / PETSc / PETGEM
  • ¥15 centos7.9 IPv6端口telnet和端口监控问题
  • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 海浪数据 南海地区海况数据,波浪数据