Tuesday, 13 January 2015

How to create webservice in php with SOAP Technology

Here we will learn how to create a SOAP based web service and know how to use a web service created with SOAP.

For creating webservice you must know the basics of following.What is Web Services
Web Services is Interaction between two machines over a network. It use SOAP, REST, and XML-RPC as a means of communication. A Web service always needs a network for its operation.
Know Difference between WebService and API

What is SOAP
SOAP stands for Simple Object Access Protocol. SOAP is an XML-based protocol for exchanging information between two computers over the internet. It enables you to Remote Procedure Calls (RPC) transported via HTTP.More About SOAP

Now Follow the following Simple Steps:1. Donwnload the library File from http://sourceforge.net/projects/nusoap/.2. Unzip/extract the downloaded zip file.3. Copy the "lib" folder from unziped folder and past in root folder of your project.
Suppose your project is myproject:
Project Location: D:\wamp\www\myproject
Library Location: D:\wamp\www\myproject\lib4.Create two files soapServer.php and soapClient.php into myproject folder.5. Add Following code in soapServer.php