Created
November 14, 2017 17:59
-
-
Save mattkasun/3b27c0cacef71c8709cc398ad6e72870 to your computer and use it in GitHub Desktop.
php soap example
This file contains hidden or 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 | |
ini_set("soap.wsdl_cache_enabled", FALSE); | |
class SOAPStruct { | |
function SOAPStruct($c) | |
{ | |
$this->varFloat = $c; | |
} | |
} | |
$client = new SoapClient("http://localhost/example/php/temperatures.wsdl", array ('trace' => 1)); | |
var_dump($client->__getFunctions()); | |
var_dump($client->__getTypes()); | |
$value = 20; | |
$param = new SoapParam ( (float)$value, "c" ); | |
$response=$client->To_Fahrenheit($param); | |
var_dump($response); | |
echo "request:\n" . $client->__GetLastRequest() . "\n"; | |
echo "request headers:\n" . $client->__GetLastRequestHeaders() . "\n"; | |
echo "response:\n" . $client->__GetLastResponse() . "\n"; | |
echo "response headers:\n" . $client->__GetLastResponseHeaders() . "\n"; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment