Archive for February, 2008

Webservice using nusoap Library

Written on February 16, 2008 – 1:20 pm | by Sanil S

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.

Posted in » WebNo Comments

Inline Editing DataTable from scratch in javascript

Written on February 8, 2008 – 5:31 pm | by Sanil S

I was looking for inline datatable for one of my web 2.0 based application. I need the table like spreadsheet. Finally i got YUI library and its seems a cool one. But i felt an issue with that its seems a big one and i don’t have an option for inline editing of Datatable header which one of my major requirement. So is started thinking of doing a datatable from scratch. When i think about it seems very easy build. So i started developing it using one of my favorite prototype library.

Step 1:

Create a dataviewer using javascript so that it wont spoil anytime for my HTML designer and the server side developer. So what i need to deliver a datatable using javascript 100%. So how can the data from the server DB to bind. Simple solution is used an associative array in javascript.

DataSource: [
{SL: "1", Name:"SANIL", Email:"sanil@mobme.in", Mobile:"9895270073", Location:"Kollam", Sex:"Male"},
{SL: "1", Name:"SANIL", Email:"sanil@mobme.in", Mobile:"9895270073", Location:"Kollam", Sex:"Male"},
]

Step 2.

Create in line editing for each cell. Simple solution create textarea / input at the time when the user click on the cell with content previously in the cell. And what do after user edit. We can simple invoke an AJAX request to update it in the server database :). So simple na to create a datatable .

Step 3.

Use AJAX calls for updating the data in the server

datatable.rar

Posted in » WebNo Comments

Android mobile developers heaven

Written on February 6, 2008 – 5:41 pm | by Sanil S

The Open Handset Alliance comprising of more than 30 technology and mobile companies developed first open and free mobile platform what we called it as Android. I think this is the apt moment for the mobile developers to open up their eyes and start developing applications. Android even allows developer phone core functionalities which include dialer with simple and standard API. The android break down all the boundaries now.

The main features include

  1. Application framework
  2. Dalvik virtual machine
  3. Integrated web browser
  4. Optimized graphics
  5. SQLite light database support
  6. Media support MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, GIF
  7. GSM telephony support
  8. Bluetoth, 3G, WiFi, EDGE
  9. Camera, GPS, Compass accelorometer
  10. Rich development environment

system-architecture.jpg

I am sure this will create a revolution in the developer communities. The android developer SDK is free to download from google code. Eclipse plugin are there to support rapid application development.

Posted in » My thoughts2 Comments