Yah, I just finished primary work for an online application. Basically I just learned how to use SOAP to access a webservice using php.
PHP 5 has introduced SoapClient class to do such things. Following is the code that I used :
If you are interested about working with simpler SOAPS without using a wsdl file you can check the following:
PHP 5 has introduced SoapClient class to do such things. Following is the code that I used :
<?phpReference :
$wsdl_url = "http://urltowebservice.wsdl";
$client = new SoapClient($wsdl_url);
$params = array('pasrm1'=>7, 'param2'=>'EN');
try {
$objectResult = $client->SomeMethod($params);
echo $objectResult->ResponseResult;
} catch (SoapFault $exception) {
echo $exception;
}
//var_dump($client->__getFunctions());
?>
If you are interested about working with simpler SOAPS without using a wsdl file you can check the following:
- http://www.ibm.com/developerworks/opensource/tutorials/os-php-webservice/section3.html
- http://www.sks.com.np/article/8/xml-web-service-using-php-and-soap.html
No comments:
Post a Comment