Webservice using nusoap Library
Web![]() |
Post Page Rank |
Modern web applications are giving more importance to developers, exposing there service to developers as external API’s. Now its the time for web 3.0, semantic web. Google, facebook, yahoo etc are exposing their service to developers. Modern web applications are now developers heaven. Google open social gonna hit the market soon, application for social networking sites like orkut, linkedIn Hi5 etc. They expose some service to developers so that developers can develop opensocial apps and install it in orkut, linkedIn, Hi5 etc.
Now web is going to a floating database (Modern Web 3.0 concept). Since all modern application exposing the service. We have some modern technology for doing it. Webservice is a way to expose services. As i am more into PHP development i am going to explain how to develop a webservice in php using nusoap library.
Developing webservice using nusoap is very simple. Nusoap library available @ sourceforge under MIT license. Now i am going to explain how a normal functions can be changed to webservice.
Step 1
Create a normal function in a page lets say service.php
function HelloWorld() {
return “Hello World”;
} // Normal function.
Step 2
Registering it as webservice
Copy the nusoap library to the working directory.
Add the code snippet
require_once(”nusoap.php”);
$server = new soap_server();
$server->register(”HelloWorld”);
$server->service($_SERVER[’HTTP_RAW_POST_DATA’]);
exit();
// The service in Registered
Look on the slide i prepared for barcampkerala2.
|
|
|
|
![]() |
Random Posts
Saturday, February 16th, 2008 at 1:20 pm and is filed under Web. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.


