R
R
Roquefort2018-03-20 16:32:26
Zend Framework
Roquefort, 2018-03-20 16:32:26

How to get response via SOAP request?

I am using ZendFramework.

$client = new \Zend\Soap\Client('http://www.webservicex.com/globalweather.asmx?wsdl');

var_dump($client->call('GetCitiesByCountry',['CountryName' => 'Russian']));  // int(0)
var_dump($client->GetCitiesByCountry(['CountryName' => 'Russian'])) // int(0)

I expect to receive a list of cities, but zero comes.
Through SOUPUI the answer is correct. The server hangs on a virtualka.
Why (judging by the getFunction response) I get wdsl, the parser works without errors, but there is no response when calling the function
var_dump($client->getFunctions())

array(4) {
  [0]=>
  string(53) "GetWeatherResponse GetWeather(GetWeather $parameters)"
  [1]=>
  string(77) "GetCitiesByCountryResponse GetCitiesByCountry(GetCitiesByCountry $parameters)"
  [2]=>
  string(53) "GetWeatherResponse GetWeather(GetWeather $parameters)"
  [3]=>
  string(77) "GetCitiesByCountryResponse GetCitiesByCountry(GetCitiesByCountry $parameters)"
}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ivan Vekov, 2018-03-20
@vekov

Try $client->getLastRequest()

K
krypt3r, 2018-03-21
@krypt3r

Comment out the call() option, it throws an exception. The $client->GetCitiesByCountry() variant is quite working, it returns a list of cities.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question