[請益] NuSoap的問題

看板PHP作者 (火鍋)時間18年前 (2008/02/26 13:38), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串1/1
各位好,有一個問題關於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都收到被編碼過的字串,例如 &lt;test1&gt; 結果讓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
try rawurldecode
02/26 18:10, 1F
文章代碼(AID): #17mwNf1J (PHP)
文章代碼(AID): #17mwNf1J (PHP)