I am running a php soap client example under https environment of my Zend Server.
I am able to list the methods in the WSDL. But when i make a call to one of those methods, i receive a 404 HTTP not found error. I also tried saving the WSDL to my local folder.
Interestingly, the same example was running successfully from the CLI (like: C:/> php abc.php). Not sure why it is failing in the browser (like: https://example.com:10022/abc.php).
This is my code:
<?php
ini_set("soap.wsdl_cache_enabled", "0");
try {
$client = new SoapClient('country.wsdl');
//$client = new SoapClient('http://www.webservicex.net/country.asmx?WSDL');
//$functions = $client->__getFunctions (); var_dump ($functions); // works
$params = array('CountryName'=> 'Australia');
$result = $client->GetISOCountryCodeByCountyName($params);
echo $result->GetISOCountryCodeByCountyNameResult;
}
catch(SoapFault $fault) {
echo $fault->getMessage();
}
?>
Note:
- I have openssl enabled.
- My https url is configured as a Zend server Virtual Host, running on port 10022.
- My https url is not reachable from outside world (does this make any difference?)