wsdl错误:HTTP错误:块终止符的套接字读取超时

时间:2013-12-11 08:29:24

标签: php web-services soap wsdl nusoap

我尝试在CMS和基于Web服务的CRM系统之间建立连接,并使用NuSOAP库。但是当我尝试向CRM服务器发出请求时,我的Web服务器(http://poseidonexpeditions.ru/soap/)会返回此类错误

wsdl error: Getting http://79.172.60.168/poseidon/soap.php?wsdl - HTTP ERROR: socket read of chunk terminator timed out"

但是,如果请求是从另一台服务器发送的 - 一切正常。如果请求被发送到另一个wsdl服务器 - 一切都很好:

http://poseidonexpeditions.ru/soap/client.php

该文件如下所示:

<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");
require($_SERVER["DOCUMENT_ROOT"]."/soap/lib/nusoap.php");
//$APPLICATION->IncludeComponent("pex:web.client");


require_once('./lib/nusoap.php');
$proxyhost = isset($_POST['proxyhost']) ? $_POST['proxyhost'] : '';
$proxyport = isset($_POST['proxyport']) ? $_POST['proxyport'] : '';
$proxyusername = isset($_POST['proxyusername']) ? $_POST['proxyusername'] : '';
$proxypassword = isset($_POST['proxypassword']) ? $_POST['proxypassword'] : '';
$client = new nusoap_client('http://79.172.60.168/poseidon/soap.php?wsdl', 'wsdl',
$proxyhost, $proxyport, $proxyusername, $proxypassword);
$err = $client->getError();
if ($err) {
    echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
}



//$myWsdl = 'http://79.172.60.168/poseidon/soap.php?wsdl';
$myAuth = array(
    'user_name' => 'foobar',
    'password' => MD5('foobar'),    
);
//$soapClient = new nusoap_client($myWsdl,true);
//var_dump($soapClient);
//
// Login
$loginParams = array('user_auth' => $myAuth);
$loginResult = $client->call('login', $loginParams);
$sessionId = $loginResult['id'];
$err = $client->getError();
echo $err;
echo '<h2>Отладка</h2>';
echo '<pre>' . htmlspecialchars($client->debug_str, ENT_QUOTES) . '</pre>'; 
echo $sessionId;
$set_entry = $client->call('set_entry', Array(
'session'=>$sessionId, 
'module_name'=>'PsdnProducts', 
'name_value_list'=>array(
            array("name" => 'ID',"value" => 1),
            array("name" => 'name',"value" => 'Test')
            )));    
echo '<pre>';
var_dump($set_entry);
echo '</pre>';            
?>

1 个答案:

答案 0 :(得分:1)

我只是猜测, 您用来向CRM发送数据的wsdl将包含许多sObject,它们将以递归方式相互引用。有时它无法正确加载wsdl。所以你应该使用一种用于发送数据的sObject,删除其他sObjects。可能会有所帮助。

谢谢,ambuj