wsdl error: HTTP ERROR: socket read of chunk terminator timed out

891 Views Asked by At

I try to build a connection between data from a CMS and a CRM systems based on web services and using NuSOAP library. But when trying to form a request to a CRM server my web server (http://poseidonexpeditions.ru/soap/) returns this kind of error

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

Still, if the request is sent from another server - everything works fine. If the request is sent to another wsdl server - everything is fine:

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

The file looks like this:

<?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

There are 1 best solutions below

0
On

I am just guessing, The wsdl you are using to send data to CRM would have lots of sObjects and they will be referring one to another in a recursive manner. Sometimes it couldn't load wsdl properly due to it. So you should use one kind of sObject which is being used to send data, remove other sObjects. May be it will help.

Thanks,ambuj