[請益] Pear SOAP 與 NuSOAP
這是一個關於已Pear SOAP 當SERVER
NuSOAP 做Client 的問題...
因為Client端主機沒辦法安裝Pear以及SOAP
所以我只好找別的SOAP來做Client
但是不知道是哪個環節出錯了
其他可以用Pear SOAP的主機當Client都沒問題
一拿出NuSOAP就出事了
請各路英雄幫忙解惑
-----------------------------------以上廢話-----------------------------------
Server
class Session
{
function checkSession{}
}
$server = new SOAP_Server;
$service = new Session();
$server->addObjectMap($service,'urn:Session');
if (isset($_SERVER['REQUEST_METHOD']) &&
$_SERVER['REQUEST_METHOD']=='POST') {
$server->service($HTTP_RAW_POST_DATA);
}
else {
$disco = new SOAP_DISCO_Server($server,'Session');
header("Content-type: text/xml");
if($_SERVER['QUERY_STRING']=='wsdl') {
print $disco->getWSDL();
}
else {
print $disco->getDISCO();
}
}
這部份以前用起來沒什麼問題
所以大概沒什麼大問題吧....我猜
---------------------------------以下Client----------------------------------
$client = new
nusoap_client('http://ooxxoo.ooo/oooo/ooxx.php');
$params = array('SessionID'=> $_GET[$this->sessName] );
$response = $client->call('checkSession',$params,"urn:Session","urn:Session");
Client大概就是這樣吧
主要的問題是...$response中取不回值
$err = $client->getError()也沒有說錯誤
是這兩款soap會打架嗎
剛剛發現錯誤訊息了...
Response not of type text/xml: text/html; charset="big5"
在$client->call('checkSession',$params,"urn:Session","urn:Session");之後
$err = $client->getError()出現的
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.220.128.164
→
08/14 15:16, , 1F
08/14 15:16, 1F
→
08/14 15:17, , 2F
08/14 15:17, 2F
→
08/14 15:19, , 3F
08/14 15:19, 3F
※ 編輯: duo3410 來自: 61.220.128.164 (08/14 15:41)
※ 編輯: duo3410 來自: 61.220.128.164 (08/14 15:42)
我把整串程式碼拿到另一台主機以後
就成功連線了...
目前猜測試伺服器設置上的問題
可是是哪邊有問題就不知道了
主要的問題應該是出在nusoap_client沒有連到目標
我在server端做紀錄發現server沒有被呼叫到
這到底是怎麼一回事呢(ˊ.ω.ˋ)?
※ 編輯: duo3410 來自: 61.220.128.164 (08/15 11:37)
PHP 近期熱門文章
PTT數位生活區 即時熱門文章