看板 PHP 關於我們 聯絡資訊
各位好,有一個問題關於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都收到被編碼過的字串,例如 &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)
appleboy46:try rawurldecode 02/26 18:10