C
C
cajka-d2021-09-16 17:13:59
PHP
cajka-d, 2021-09-16 17:13:59

Why is it giving an error when making a request to the server via SOAP?

Hello.

I'm using SOAP to send requests to the server, but I'm getting an error.

The error itself is:
Fatal error: Uncaught SoapFault exception: [HTTP] Could not connect to host in D:\OpenServer\domains\test\kargo\clilent-kargo.php:38 Stack trace: #0 [internal function]: SoapClient- >__doRequest('<?xml version="...', ' 89.208.1 ...', ' www.carg ...', 1, 0) #1 D:\OpenServer\domains\test\kargo\ clilent-kargo.php(38): SoapClient->__call('Tracking', Array) #2 {main} thrown in D:\OpenServer\domains\test\kargo\clilent-kargo.php on line

38

<?php

// проверяем наличие класса SoapClient
if (class_exists('SoapClient')){
    ini_set('soap.wsdl_cache_enabled',0);
  ini_set('soap.wsdl_cache_ttl',0);

    // подключаемся к серверу
    $client = new SoapClient(
            'http://89.208.141.8/CargoMSK/ws/Web1C.1cws?wsdl',
            array(
                'login' => "web", // логин
                'password' => "web", // пароль
        'connection_timeout' => 1,
        'cache_wsdl' => WSDL_CACHE_NONE
            )
        );

$a = array(
  'login' => 'login',
  'password' => 'pass',
  'documents' => array(
    'Key' => 'Documents',
    'Properties' => array(
      'Key' => 'DocumentType',
      'Value' => 'Order',
      'ValueType' => 'string'
    ),
  'List' => array(array('Key' => '00-00000497004'))
  ),
  'parameters' => array('Key' => 'parameters')
);

//print_r($client->__getFunctions()); 

$d = $client->Tracking($a);
print_r($d);
?>


This line works well.
print_r($client->__getFunctions());

And the error occurs when calling the method:
$d = $client->Tracking($a);

Maybe someone will tell you what could be the matter? How to solve the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rsa97, 2021-09-16
@Rsa97

The WSDL file says

<soapbind:address location="http://89.208.141.8:8888/CargoMSK/ws/Web1C.1cws"/>

At the same time, no one is listening to port 8888 of this IP address, the port is closed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question