作者arianda (火锅)
看板PHP
标题[请益] NuSoap的问题
时间Tue Feb 26 13:38:46 2008
各位好,有一个问题关於php跟WebServier之间连线的问题,小弟是用nusoap与
webserver来连线
在测试的webservice
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="
http://www.w3.org/2001/XMLSchema"
xmlns:soap="
http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<TestConn xmlns="
http://tempuri.org/">
<getString>string</getString>
</TestConn>
</soap:Body>
</soap:Envelope>
PHP code如下
<?
include('nusoap/lib/nusoap.php');
$soapclient = new
soapclient('
http://192.168.1.1/TestWS/Service.asmx?WSDL',true);
$soapclient->soap_defencoding = 'UTF-8';
$soapclient->decode_utf8 = false;
$result=$soapclient->call('TestConn',array('parameters'=>array('getString'=>'
中文测试')));
print_r($result);
?>
这部份可以正常使用,webservice可以收到我传入的字串
可是当我要传入xml字串时
$result=$soapclient->call('TestConn',array('parameters'=>array('getString'=>'<test1>ABC</test1><test2>DEF</test2>')));
webservice都收到被编码过的字串,例如
<test1>
结果让webservice收不到正确的xml 字串
在google与nusoap的document翻了很久找不到类似的说明, 小弟接触xml还不是很久,
请问我应该先study那一部份?
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 60.250.32.15
※ 编辑: arianda 来自: 60.250.32.15 (02/26 13:40)
1F:推 appleboy46:try rawurldecode 02/26 18:10