Tag: Webservice

Simple RESTful API webservice demo in PHP

API URL :  http://domain_name/api.php

Input param :

API Call Request :

Successfull Output :

Error Output :

API Script (api.php) :

database_configuration.php

You can download all above demos from below link :

Download Source Code

Or

Browse source code in github : https://github.com/sagarsdeshmukh/RESTful_Webservice_Demo

SOAP Web Service Demo using NuSOAP library

The main advantage of using NuSOAP library is it allow developers to create and consume web services based on SOAP without any SOAP related PHP extensions.
If we were not able to predict production server system configuration(Like PHP version) then using of NuSOAP based web service is better.
It’s very easy to create and test webservice using NuSOAP library.

First we created the NuSOAP server which process web service request

Note : The “<webservice_url>” is absolute path of your webservice script(nusoap_api.php).
Ex. <webservice_url> = http://www.ilovephp.net/nusoap_api.php

Download Source Code

 

To consume and test above webservice we use below webservice client script.

 

Download Source Code

That’s it about NuSOAP webservice.
Happy Coding 🙂