Web Service Development

A definition first:  A web service is essentially a collection of subroutines on a web server that can be called remotely, by other machines on the web.  Web Services are sometimes referred to as “XML Web Services” because all communication to and from a web service is by transmitting XML data back and forth.  It’s not just any old XML data.  It has to be formatted via the SOAP specification.  SOAP web services usually provide a WSDL file (pronounced Wizdul) that describes the methods (subroutines) available, their names, the parameters they take, the types of the parameters, the data types they return, and a description of each method.

WSDL makes them easier to consume by 3rd party developers.  With this, they don’t necessarily need printed documentation which means the web service provider doesn’t have to worry (as much) about how to get the documentation to the 3rd party developers to being writing software that makes calls to the web services.

A web service method can do pretty much anything any subroutine can do.  They’re generally used to simplify distributed computing application development.  By putting the web services on a public (or partially public) server, as opposed to distributing DLLs, it gives the web service provider the ability to make internal changes without having to notify all other application owners.  If the changes are only internal, and don’t affect the names of the methods or their parameters or the types of their parameters or return types, then no changes are needed to any of the multitude of remote applications that may be making use of the web services.

Some examples of web services:

Google:  Google hosts a plethora of web services, though none of them are SOAP web services.  Though this does make them accessible to more developers, it also makes them more difficult to code against because a lot of software development products have direct support for SOAP web services, eliminating the need to manually encode and decipher the custom XML that Google uses.

UPS:  UPS provides web services for providing live costs for packaging.  For example, an online merchant, such as www.MichaelsAttic.com can provide their shoppers with instant quotes on shipping expenses by sending the ship from address, the customer’s ship to address, and the sizes and weights of the packages to the UPS web services.  In response, the UPS web services provide the cost of shipping.  The United States Postal Service provides similar web services.

Google Checkout and PayPal:  Both of these services provide online purchase transaction capability via web services.  www.MichaelsAttic.com uses Google Checkout, for example.

There are many many weather related web service providers, stock quote web service providers, foreign currency exchange web services and just about anything you can imagine.

Creating a Web Service:

Pretty much any language can be used to create a web service.  I’m partial to .NET technologies to create web services.  To create a web service is significantly different depending on the language and the technology you choose to create them.  Some development technologies make is ridiculously simple by coding all of the monotonous XML translation for you.  Others have zero support, requiring you to hard code it all yourself.  With .NET technologies, you simply create a “web service” project, which creates a new class for you in code, then you put “[Webmethod]” on the line above each class method you want to expose as a web service method.  It really couldn’t be simpler.

Leave a Reply