Created
June 23, 2017 06:04
-
-
Save Lougarou/e67a6fc7b65124b0799f33d14a6f2c72 to your computer and use it in GitHub Desktop.
PHP SoapClient Usage as seen on http://therandomtechadventure.blogspot.com/2017/06/working-with-soap-in-php.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$client = new SoapClient("http://www.webservicex.com/globalweather.asmx?WSDL", array('trace' => 1, 'exceptions' => false)); | |
var_dump($client->__getFunctions()); | |
var_dump($client->__getTypes()); | |
$params = [ | |
"CityName" => "San Francisco", | |
"CountryName" => "United States" | |
]; | |
$responses = $client->__soapCall("GetWeather", array($params)); | |
echo "REQUEST:\n" . $client->__getLastRequest() . "\n"; | |
echo "RESPONSE:\n" . $client->__getLastResponse() . "\n"; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment