This example requires PHP version 5.0
<?php
// defining some options that should be used
$soapOptions = array(
"trace" => 1
,"exceptions" => 1
// setting soap version 1.2
,"soap_version" => SOAP_1_2
// http connection timeout
,"connection_timeout" => 5
// we are doing a rpc styled soap call
,"style" => SOAP_RPC
/* using http basic authentication
,"login" => "some_name",
,"password" => "some_password"
*/
);
// enabling content encoding gzip
if (in_array("zlib", get_loaded_extensions())) {
$soapOptions["compression"] = SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP;
}
// doing the soap call
try {
$client = new SoapClient("http://192.168.0.5:8090/test",$soapOptions);
$result = $client->__call("test", array(), NULL,NULL);
} catch (SoapFault $fault) {
$result = $fault->faultstring;
}
// printing the result
print($result);
?>