[請益] NuSoap的問題
各位好,有一個問題關於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="" rel="nofollow">http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<TestConn xmlns="" rel="nofollow">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)
推
02/26 18:10, , 1F
02/26 18:10, 1F
PHP 近期熱門文章
PTT數位生活區 即時熱門文章