In-Sights into Web Services - Part 1

Introduction

Off late, Web services are one the buzz word most of the software people uses. In this article let us try to understand the basics of Web Service. Let us start off by asking our self “What is a Web Service?”

What is a Web Service?

Web Service is software components that expose a service over the web.

  • It allows applications to share data and functionality.
  • It can be called across platforms and operating systems regardless of the programming language used by applications.
  • You can invoke this application programmatically over the Web using SOAP protocol.

In .Net a web service is an ASP.NET application with <.asmx> extension. The basic elements of web services are SOAP (XML + HTTP), UDDI and DISCO.

UDDI

UDDI stands for Universal Description Discovery and Integration. UDDI defines a way to publish and discover information about web services.

UDDI is like a registry rather than like a repository. A registry contains only reference information. For example, the windows registry contains the name of COM objects and not the entire code. When we invoke a COM object, the system finds the registry entries and then it redirects execution to the actual binary part for that COM object. UDDI works the same way!

Using Microsoft UDDI SDK, web services can be registered for public use at http://www.uddi.org . VS.NET provides a web service with the option to register and publish itself from the IDE.

DISCO (Discovery)

After choosing a web service through UDDI the next step is to access its discovery. Discovery is the process of locating and examining XML Web Service descriptions. Through this process a client understands that web service capabilities. Programmatic discovery is enabled through a “.disco” file, which is an XML document that contains links to other discovery documents, XSD schemas and service descriptions (WSDL).

A discovery document is automatically generated for an XML Web service when the web service is accessed using a URL with “?DISCO” in the query string.

For instance, if the URL to an XML Web service is http://www.vadivel.com/Calc.asmx , then a discovery document is automatically generated with a URL of http://www.vadivel.com/Calc.asmx?DISCO .

SOAP and WSDL

SOAP stands for Simple Object Access Protocol. SOAP is an XML based lightweight protocol, which allows software components and applications communicate, mostly using HTTP. SOAP sits on top of the HTTP protocol. It is message-based and nothing but an XML document with a pre-defined format.

The following features make SOAP the most preferred way of communication over the web:

  • Platform independency
  • Language independency
  • XML based
  • Based on W3C standard

Every SOAP message has an envelope, a header (optional) and Body (SOAP message in XML format).

  • The envelope defines the content of the message.
  • The header (optional) contains header information.
  • The body contains call and response information.

Before the advent of web service and .Net, technologies like DCOM/CORBA etc., were used for network communication. But those were vendor specific and interoperability between them was quite complex.

Remote procedure calls (RPC) was used for communication between technologies like DCOM and CORBA, but HTTP was not designed for this. Most of the corporate networks use proxy/firewalls that allow only HTTP requests (Firewalls/proxy servers would normally block RPC). Web sites too allow mostly HTTP traffic through port 80.

All Internet browsers and servers support HTTP. So HTTP is generally a better way to communicate between applications. That’s where SOAP comes into play.

Web Service Description Language (WSDL)

Let’s say we have created a web service. How does the consumer know how to use it? Like, which method to invoke and what parameters to pass?

There are many possible ways we can think of to accomplish this task.

  • May be we can write a document that provides this information or
  • We can verbally explain the information to the user.

These informal approaches have at least one serious problem. When developer sits down to build a client for your web service, their development tool cannot offer them any help because that tool has no idea about the web service’s functions and parameters. The solution is to provide a formal description in a machine-readable format.

The WSDL is an XML-based grammar for describing the web services; it’s a function, parameters and return values. Being XML-based, WSDL is both machine and human readable.

Conclusion

In this article I have explained about the basic elements of Web Services. In the next article we would look deep in to the topic “Web Services in .NET”. Feel free to ping me at vmvadivel@gmail.com for any further discussion about this. On the other hand you can catch me @ http://vadivel.thinkingms.com . Happy programming!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值