Webservice is very famous way to communicate your website and database,Now days mobile platform is popular way to access your website.Webservice is way to communicate your website with mobile users without worry mobile platform.The webservice are three type SOAP/REST and XML.The webservice response type would be Json and XML.
You can also check other tutorial of magento api,
How To Use Magento API with SOAP
* @created by : Parvez Alam */
//disables the soap catch .Its also handled from php.ini file.
//creating the soap client with help of Api URL
$client = new SoapClient("http://localhost/magento/index.php/api/?wsdl");
//login with webservice username and password
$session = $client->login("username", "password");
//call the webservice method
$result1=$client->call($session, 'sales_order.getTicketPrice', array());
//Note:sales_order is resource name which is define in api.xml
}catch (Exception $e)
Magento also has in-built API service.You can call webservice in magento is very easly.its only 3 step process ,First we create the soap client with help of Soap API URL then generate session with username and password,Finally we can access all webservice method From Soap Webservice Api.