Web Services. Part I: The Basics
Web Services. Part I: The Basics
Saurabh Nandu
Feb 15, 2001
Level: Beginner/Intermediate
Introduction
Today the business have crossed the boundaries of the Corporate Intranets and Virtual Private Networks. The business models have changed from 2 tier to n-tier models, with the business's linking up with other partners, suppliers, distributors and Consumers.
This has led to the need for programmers to develop huge applications managed across platforms and geographical boundaries. This has become a headache for you, hasn't it? Trying to maintain and deploy your application across different Platforms and making applications written in different Languages work together. The interoperability between such platforms and programming languages is one of the major problem which leads to large expenditure on developing, maintaining and deploying such applications.
On the lines of the Windows DNA 2000 architecture Microsoft is promoting a solution for programmers like us to solve interoperability issues which is called as "Web Services."
"Web Service is just like a application delivered as a service on the Web"
I guess you just overlooked the above line as a theoretical definition, didn't you? The above definition explains a lot about Web Services.
"Web Service is just like a application"
This makes it clear that Web Services are nothing but applications. Hence they do provide the functionality that usual applications provide. It also means that like applications Web Services contain business logic (Programmable logic) which separates the clients from the persistent database. One notable point would also be that Web Services can be distributed as applications i.e The web server can provide the Web Service, the database server can provide the data, etc.
"delivered as a service"
You could compare Web Services to Windows NT services. Hence Web Services also contains the functionality of services. It runs in the background and waits for clients to connect to it. Since it is a service it frees you, the programmer, of writing code for the Web Service to listen for multiple clients - it automatically does that for you.
"on the Web"
These words mean a lot, if you think deep enough. A common thought would be that it can be called through the Browser. i.e.. It is URL addressable and can be invoked by any browser by just typing the Path to the Web Service. But it also means the following.
Protocol
For those of you who are well versed with Internet Protocol would know that since Web Services are delivered over the Internet they have to use either of the two widely used protocols for communication "FTP or HTTP". FTP is for transferring files so it get ruled out leaving us with one choice "HTTP". You guessed it right "HTTP" is the protocol used by Web Services to communicate. So what?
Well this has a widespread effect. Firstly unlike other Remote Object Models like Distributed Component Object Model (DCOM), Remote Method Invocation (RMI), or Internet Inter-ORB Protocol (IIOP) which use Object - Model - Specific Protocols, Web Services use the HTTP protocol to communicate with the clients. This decreases the burden on you to learn, understand and master one more new protocol. Also since your company already might be having a good infrastructure to support HTTP huge expenses on new Infrastructure is reduced. HTTP as we all know is royalty free, highly tested, proven and used technology so you don't have to worry about its bugs at all.
Communication via messages
The Web Service Interface can be strictly defined in the terms of messages a Web Services Accepts and Generates. This means that communication with Web Services takes place in the form of Messages. Since as you all would agree XML has become the standard of representation of Data on the Internet, it is very obvious MS has chosen XML to be the format of the messages.
Another standard coming up is SOAP (Simple Object Access Protocol), this is basically a set of rules defining how to use XML for representation of Data and conventions for representing remote procedure calls (RPCs). To sum it up, Web Services use SOAP encoded XML messages to communicate.
The obvious question coming up your mind would be, "Do I have to learn SOAP and XML?" No. The Web Service takes care of all the coding and decoding, you just have to concentrate on you programming. Using SOAP and XML formatted messages over HTTP allows the consumers of the Web Service to be on any platform, object model and programming language as long as the client can interpret and generate SOAP encoded XML messages. This is the key to Web Service's clients being interoperable.
The next question that would pop-up in your minds is what kind of Data can I transfer over Web Services ? Just about anything that is "serializable". For a partial listing see below.
List of items the Web Service can Pass
to its clients:
Parameters that can be passed to a Web Service
Both by-value and by-reference (in/out) parameters are supported when using the SOAP protocol. By-reference parameters have the effect of sending the value both ways: up to the server, and back to the client. When passing input parameters to a Web Service via HTTP GET/POST, only a limited set of data types are supported, and they must be by-value parameters. The supported types for HTTP GET/POST parameters are listed below:
Service Description
How does a client know what Methods, Parameters etc. are supported by the Web Service ? To solve this issue all Web Services automatically generate a XML file formatted in SDL (Service Description Language). This resource is also URL addressable and you can get it from your browser by just appending "?SDL" after the path to the Web Service. e.g. "http://myhost.com/services/myservice.asmx?SDL" will Generate a SDL formatted for the Web Service "myservice". SDL is nothing else but just a grammar for documenting Web Service Contracts. So you can use the SDL file of a Web Service and know exactly what methods, parameters are supported by the Web Service.
Service Discovery
Once Web Services get widely used there might arise the problem of discovering the right Web Service for your need. To address to this problem Web Services also provide Service Discovery (DISCO) files. Also one more specification provided with the Web services is the Service Discovery (DISCO). Service Discovery is the standard way to be used by Web Service providers to provide service contracts. This helps the developers to easily discover the Service Contracts for the Web Services.
I guess by now you should have got a good idea about Web Services and its functioning. So let us jump to its architecture for knowledge of its internal design.
Web Service Architecture
Web Services are programmable web applications containing business logic accessible via Standard Internet protocols. Web Service architecture is based on the Windows DNA 2000 architecture. It is a multi-layered architecture. At the very base is the persistent database. The database does not come in direct contact with the Client at anytime keeping the database safe for malicious attract . The data access layer acts as the link between the persistent database and the Web Service.
Also the data access layer can use data from other Web Services. Above the Data Access Layer lies the all important Business Logic Layer. You can divide this layer into multiple parts according to your need. E.g. One layer could look after validating your database and other layer could format you data according to your needs. This layer contains all the logic that should be executed to process the Raw Data from the client or from the Data Access Layer.
The above layers do not contain any UI components. They are just programmable parts which should be optimized to bear load of bulk requests also they should be fault tolerant and should be able to recover from faults quickly. Since most work is done by the Business Logic layer it should be also scalable and fast.
Above the these layers is the Listener layer. This layer listens for client requests for Data and for Contract. It the listener layer that is responsible for decoding data submitted by clients and packaging the Data from the Business Logic layer and transmitting it to the client. Listener is the only layer in the Web Service that know its a part of the Web Service. When a Web Service is called the Listener layer is the only layer that comes in direct contact with the Client. Also requests for service contracts are fulfilled by the listener layer. The Listener layer is in-built in Web Services so you don't have to worry of implementing it.
Future
As business on the Web will evolve the dependence and need for Global applications which work across platforms and programming languages will increase significantly. Thus need for some standard technologies which solve interoperability issues will arise. With .NET Microsoft has visualized this had placed a significant step in the process of interoperable programming. Web Services will form a important part of such business architecture. Also by embracing the standard and globally used protocols like HTTP, SOAP and XML Web Service decrease the cost of acquiring special platforms to use it.
Integration of Web Services with ASP.NET makes development Very fast and scalable. Some of the areas where Web Service could have a major impact would be content providers, peer to peer computing, large business structures, customer support etc.
- 1What is a digital dashboard?
- 2Web服务面临的课题:安全和标准化
- 3实用工具:IT员工的培训补偿政策示例
- 4TIBCO来华布道Web服务战略
- 5BEA支持JAX-RPC标准
- 6我国商贸业将迎来新一轮的IT建设高潮
- 7网络、知识增长和经济发展
- 8BEA举办BEA WebLogic Platform 7.0新产品推介会
- 9OA办公系统可以帮助企业摆脱束缚
- 10Web Services with ASP.NET
- 11Accessing Web Services From DHTML
- 12协同之惑
- 13EIP 相关资源
- 14Re: 知识时代企业的四个要素
- 15尊重知识 崇尚理性
- 16Web服务内幕,第2部分: W3C Web服务专题研讨会的概述
- 17一个副总裁的辞呈:瘫痪的信息化系统和人心
- 18关于资料收集的一些心得(by AMT 罗赞)
- 19BEA荣获最佳web服务产品奖
- 20石家庄OA信息化新典范--深入访谈中华汽车石家庄OA信息化推动团队
- 21Web服务的(革)创新,第3部分
- 22KnowledgeManagement at Best Buy
- 23Web服务内幕,第5部分:进入流--用WSFL建模的商业流程
- 24专家称XML Web服务时代正接近尾声
- 25SOAP技术与B2B应用集成--SOAP的型系统和数据编码规则
- 26微软、PwC和纳斯达克联合推出财报Web服务
- 27知识库建设应规避的5点具体误区
- 28关于石家庄OA信息化的几个问答(by AMT 夏敬华)
- 29将旧应用改造成Web服务
- 30理解Web服务互操作性
成都公司:成都市成华区建设南路160号1层9号
重庆公司:重庆市江北区红旗河沟华创商务大厦18楼