Skip to content

Instantly share code, notes, and snippets.

@mattkasun
Created November 14, 2017 17:59
Show Gist options
  • Save mattkasun/3b27c0cacef71c8709cc398ad6e72870 to your computer and use it in GitHub Desktop.
Save mattkasun/3b27c0cacef71c8709cc398ad6e72870 to your computer and use it in GitHub Desktop.
php soap example
<?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