Everything worked, until one day they decided to change all the connections, in the end, 1c-nick set up communication through another port and gave a link of the form (used to work without a port, I mean the standard one):

http://00.000.000.000:55/Trade/ws/SiteExchange?wsdl (do not write, as it works with 0s, this is superseded data)

And now there is always a mistake. Maybe someone will tell something ... Here is a piece of code:

try { $client = new SoapClient('http://00.000.000.167/Trade/ws/SiteExchange?wsdl', array('login' => 'user', 'password' => 'pass', 'soap_version' => SOAP_1_2, 'cache_wsdl' => WSDL_CACHE_NONE, //WSDL_CACHE_MEMORY, //, WSDL_CACHE_NONE, WSDL_CACHE_DISK or WSDL_CACHE_BOTH 'exceptions' => true, 'trace' => 1)); } catch(SoapFault $e) { trigger_error('Ошибка подключения или внутренняя ошибка сервера. Не удалось связаться с базой 1С.', E_ERROR); var_dump($e); } 

PS If you just enter the link into the browser, it will request a login and pass, and entering them will give the information ...

  • What kind of mistake is that? (show the contents of SoapFault $ e). - Timurib
  • For the replaced data there are example domains, for examples of IP - three whole subnets 192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24 by rfc5737. So far it is not obvious that you have correctly specified the port. Is wsdl itself also locked by basic auth authorization? - Small
  • The port is in the address bar as given and recorded - Oleg Shleif
  • Please tell me how you need to specify it correctly ... - Oleg Shleif

2 answers 2

The client cannot download wsdl . I understand that you wsdl itself is also closed for http basic authorization.

SoapClient does not attempt to use the login and password parameters to get wsdl and assumes that the document is available via a direct link without authorization. But the standard authorization entry directly in the URL understands and can use :

 $client = new SoapClient( 'http://' . urlencode($login) . ':' . urlencode($password) . '@00.000.000.167/Trade/ws/SiteExchange?wsdl', array('login' => $login, 'password' => $pass, 'soap_version' => SOAP_1_2, 'cache_wsdl' => WSDL_CACHE_NONE, 'exceptions' => true, 'trace' => 1)); 
  • I tried using the port and not using it, all the same error - Oleg Shleif
  • Another such question, login with a capital letter, can it influence? - Oleg Shleif
  • You have a non-standard port for http - so the port must be specified. Try from the machine where your client starts to request a wsdl with something more sociable. For example, a console curl. - Shallow
  • Today revealed new circumstances! It turns out the connection from LAN (Ubuntu, lamp) passes, everything is fast, all the necessary info is displayed. And there is no hosting. Can throw thoughts ?? - Oleg Shleif
  • firewall (on both hosts), web server ACL, ACL in SOAP server implementation. A bunch of them. That even cant routing. Download wsdl with something more talkative, so it will be clear if there is a tcp connection that responds to the http request. - Small

In the parameters of the soap added 'verifyhost' => false and everything went!