The request looks like this:

<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <Buy xmlns="http://tempuri.org/"> <perf> <param1>1111</param1> <param2>2222</param2> </perf> </Buy> </soap:Body></soap:Envelope> 

I make a request through SoapClient:

 $client = new SoapClient("http://0.0.0.0:8080/Service1.asmx?wsdl", array( 'trace' => true, 'exceptions'=>true )); 

getTypes and getFunctions work correctly.

 $types = $client->__getTypes(); $functions = $client->__getFunctions (); 

I create an object and try to see the result:

 $std = new stdClass(); $std->param1 = '1111'; $std->param2 = '2222'; ini_set("soap.wsdl_cache_enabled", "0"); // отключаем кэширование WSDL $result = $client->Buy( array('perf' => $std ) ); var_dump($result); exit; 

As a result, I get SoapFault:

 Fatal error: Uncaught SoapFault exception: [HTTP] Could not connect to host in /var/www/index.php:86 Stack trace: #0 [internal function]: SoapClient->__doRequest('__call('Buy', Array) #2 /var/www/index.php(86): SoapClient->Buy(Array) #3 {main} thrown in /var/www/index.php on line 86 

Apache logs have the following:

 PHP Fatal error: Uncaught SoapFault exception: [HTTP] Could not connect to host in /var/www/index.php:86\nStack trace:\n#0 [internal function]: SoapClient->__doRequest('<?xml version="...', 'http://0.0.0...', 'http://tempuri....', 1, 0)\n#1 /var/www/index.php(86): SoapClient->__call('Buy', Array)\n#2 /var/www/index.php(86): SoapClient->Buy(Array)\n#3 {main}\n thrown in /var/www/index.php on line 86 

Tell me, who knows, maybe the problem is how do I collect the data object? Or how I interpose parameters into request?

  • Download this wsdl yourself and look at what address it is supposed to connect there. - Pavel Mayorov
  • Judging by the error, the problem is that the client cannot connect to the server on port 8080, i.e. Either the server address is incorrect or access to it is blocked. - Alexey Shmelyov
  • @ Alexey Shmelyov, it is normal to knock to the server When I getFunctions or getTypes, I get the expected result from the server. But when I make a specific request for the function - such an error - Oleg Potemkin
  • @PavelMayorov, the address for the request is correct - Oleg Potemkin
  • @ Oleg Potemkin correct - which one? I can't understand how it connects to you at all at 0.0.0.0 ... - Pavel Mayorov

0