Calling WSDL WebService From PHP.
Web service is a way of comunication over the internet. It is Language independent. We can call Web service from PHP by using Curl Library. For that we have to enable the Php_curl library from the php.ini file.
<?php
// URL of the Web Service
$url=”http://localhost/Test/Service1.asmx/Test?name=”.$_POST["fcurrency"];
// initiate the Curl library.
$ch = curl_init();
// initiate the Curl library.
// for reference see:- (http://www.php.net/curl_setopt)
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
// get the Response from the WebService
//for reference see:- (http://www.php.net/curl_exec)
$x=curl_exec($ch);
?>