Pages

Tuesday, November 13, 2007

Web Services - Why and How to Build

Have you ever interface a web service before. A web service consists of a server to serve requests to the web service and a client to invoke methods on the web service. Web Services is a modern and very popular technology. Some popular public sites that offer their web service are Flickr, Facebook and so many social site like MySpace, LinkedIn, Hi5 and others though Google's OpenSocial web service.

With Web services readily available, and as the pool of XML Web services grows, you will be able to find software modules that can be integrated into your own application, by finding it and integrating it through XML Web services. Integrate with existing Web services instead of reinventing them. The bottom line is that you will be able to develop much faster than before.

Here are some reasons why Web Services should work where prior approaches have failed
  1. Universal Support. Previous de facto, or de jure interoperability standards usually lacked participation by one or more key vendors.
  2. Protocol not Platform. It doesn’t require the adoption of a common platform, just adherence to the standard protocols.
  3. Low Product Costs. Sure vendors will want to sell products that optimize the Web Service experience in some way, but the basic needs are going to be supported essentially for free as part of the platform or as an adjunct to some existing product. Nor are they expensive to adopt in term of development effort. Everyone can play this game without major investment.
  4. Evolutionary. Long term, Web Services will likely usher in some revolutionary new ideas that force the replacement of existing systems. In the meantime consider Web Services as evolutionary and use them to leverage your existing applications and infrastructure rather than requiring rip and replace - another low cost benefit.
  5. Business Oriented. Web Services don’t just appeal to the technician, but directly address real business needs of today. The business didn’t care about OO or CBD, but should care about Web Services, particularly where they directly reflect some meaningful business concept, and especially where they are being exposed external – and hence are a reflection on the business.
The list of protocols and technologies related to Web Services grows every day, but SOAP is probably the most important. It is rapidly becoming the standard protocol for accessing Web Services. So you might want to consider to add web service on you current development plan.

So now probably you are wondering how to build your own web service based on your current application. Since web service is a protocol, platform doesn't really matter. You probably could build a web service from ColdFusion, PHP, ASP or JSP but for a start let just pick PHP. There two methods of creating web services in PHP, SOAP Web Service & XML-RPC Web Service.

Deepak Vohra wrote an excellent tutorial on how to create web service with SOAP & XML-RPC in PHP 5 for a beginner. I've tested the code and I'm quite sure you'll get the idea pretty quick.

What do I hope from all this? I would like to see more and more web service coming from our soil, specifically Malaysia. Perhaps the web service could create some degree of access in some of our government agencies database. Maybe directly pay the Hulu Selangor's land tax through Maybank2u or other payment method so that they won't receive another "Penyapu" award next year from Khir Toyo. Still, anyone could contact me if you need further consultation.

No comments: