You are on page 1of 12

78060105 Web Service Latest Technologies Web Service

78060105 Services Latest Technology

Web

1. Web Services Introduction 2. Accessing a Web Service 3. Web Service Example 4. Basic Web Service Concepts
5. Web Service Behavioral Characteristics

6. Internal Communication 7. Consuming Web Services 8. Advantages & Disadvantages of Web Services 9. Implementing Web Services 10. Web Services Infrastructure 11. Web Services Technologies and Tools

78060105 Services Latest Technology

Web

1. Web Services Introduction


Web services are basically a modern form of a remote procedure call (RPC) system. They allow applications on one machine to execute operations on another machine. Systems integrators use web services to make widely differing systems talk to one another.

2. Accessing a Web Service


In its simplest form, an access to a web service is similar to a function call. Instead of the function call referencing a library on your computer, it references remote functionality over the Internet. One feature of web services is that they are self-describing. That means a person who makes a web service available also publishes a description of the API to the web service as a Web Services Description Language (WSDL) file. A WSDL file is an XML-formatted document that includes information about the web service, including the following information:

Operations that you can call on the web service Input parameters that you pass to each operation Return values from an operation

Consuming web services typically is a two-step process: 1. Parse the WSDL file of the web service to determine its interface. A web service makes its associated WSDL file available over the Internet. You must know the URL of the WSDL file defining the service. 2. Make a request to the web service. The following example invokes an operation on the Temperature web service to retrieve the temperature in zip code 55987:

78060105 Services Latest Technology

Web

3. Web Service Example


To understand, let's take a look at a hypothetical example. Imagine a class like this:

This could be a local function operating on your own machine, or it could be a web service. If it were a web service, the actual code that returns the headline might be running on some other machine somewhere on the Internet. You don't have to know what it's doing; there might be a database on the other end of the service, a screenscraper, or a carrier-pigeon-message translation service. The code on the remote webserver might be PHP, Java, Python, or COBOL. That's the point of web services.
4.

Basic Web Service Concepts

The following are three primary components of the web services platform:

SOAP (Simple Object Access Protocol) WSDL (Web Services Description Language) UDDI (Universal Description, Discovery, and Integration)

The following simple image shows how the ColdFusion implementation of web services work:

78060105 Services Latest Technology

Web

Supporting web services with SOAP SOAP provides a standard XML structure for sending and receiving web service requests and responses over the Internet. Usually you send SOAP messages using HTTP, but you also can send them using SMTP and other protocols. ColdFusion integrates the Apache Axis SOAP engine to support web services. The ColdFusion Web Services Engine performs the underlying functionality to support web services, including generating WSDL files for web services that you create. In ColdFusion, to consume or publish web services does not require you to be familiar with SOAP or to perform any SOAP operations. Describing web services with WSDL A WSDL document is an XML file that describes a web service's purpose, where it is located, and how to access it. The WSDL document describes the operations that you can invoke and their associated data types. ColdFusion can generate a WSDL document from a web service, and you can publish the WSDL document at a URL to provide information to potential clients. Finding web services with UDDI As a consumer of web services, you want to know what web services are available. As a publisher of web services, you want others to be able to find information about your web services. Universal Description, Discovery and Integration (UDDI) provide a way for web service clients

78060105 Services Latest Technology

Web

to dynamically locate web services that provide specific capabilities. You use a UDDI query to find service providers. A UDDI response contains information, such as business contact information, business category, and technical details, about how to invoke a web service.

5. Web Service Behavioral Characteristics


Web services have special behavioral characteristics

XML-based Web Services uses XML at data representation and data transportation layers. Using XML eliminates any networking, operating system, or platform binding. So Web Services based applications are highly interoperable applications at their core level.

Loosely coupled A consumer of a web service is not tied to that web service directly. The web service interface can change over time without compromising the client's ability to interact with the service. A tightly coupled system implies that the client and server logic are closely tied to one another, implying that if one interface changes, the other must also be updated. Adopting a loosely coupled architecture tends to make software systems more manageable and allows simpler integration between different systems.

Coarse-grained Object-oriented technologies such as Java expose their services through individual methods. An individual method is too fine an operation to provide any useful capability at a corporate level. Building a Java program from scratch requires the creation of several fine-grained methods that are then composed into a coarse-grained service that is consumed by either a client or another service. Businesses and the interfaces that they expose should be coarse-grained. Web services technology provides a natural way of defining coarse-grained services that access the right amount of business logic.

Ability to be synchronous or asynchronous

78060105 Services Latest Technology

Web

Synchronicity refers to the binding of the client to the execution of the service. In synchronous invocations, the client blocks and waits for the service to complete its operation before continuing. Asynchronous operations allow a client to invoke a service and then execute other functions. Asynchronous clients retrieve their result at a later point in time, while synchronous clients receive their result when the service has completed. Asynchronous capability is a key factor in enabling loosely coupled systems.

Supports Remote Procedure Calls (RPCs) Web services allow clients to invoke procedures, functions, and methods on remote objects using an XML-based protocol. Remote procedures expose input and output parameters that a web service must support. Component development through Enterprise JavaBeans (EJBs) and .NET Components has increasingly become a part of architectures and enterprise deployments over the past couple of years. Both technologies are distributed and accessible through a variety of RPC mechanisms. A web service supports RPC by providing services of its own, equivalent to those of a traditional component, or by translating incoming invocations into an invocation of an EJB or a .NET component.

Supports document exchange One of the key advantages of XML is its generic way of representing not only data, but also complex documents. These documents can be simple, such as when representing a current address, or they can be complex, representing an entire book or RFQ. Web services support the transparent exchange of documents to facilitate business integration.

6. Internal Communication
In order to use a web service, Mono requires a descriptor file written in WSDL (Web Services Description Language). WSDL is an XML description of the API for a given web service. Mono's tool WSDL knows how to translate a WSDL file into a C# library that can run that web service. The local library file is a wrapper around the web service, but it gets installed into the GAC just like any other library.

78060105 Services Latest Technology

Web

7. Consuming Web Services


As an example of what can be done with web services, let's use a part of Google's publicly accessible web services, the Google spell checker. When you enter "spelll checker" in Google, it will ask you if you meant, "spell checker". With the Google web service, you can use that function directly from C#.

8. Advantages and Disadvantages of Web Services


Advantages:

Interoperability - This is the most important benefit of Web Services. Web Services typically work outside of private networks, offering developers a non-proprietary route to their solutions. Services developed are likely, therefore, to have a longer lifespan, offering better return on investment of the developed service. Web Services also let developers use their preferred programming languages. In addition, thanks to the use of standards-based communications methods, Web Services are virtually platform-independent. Usability - Web Services allow the business logic of many different systems to be exposed over the Web. This gives your applications the freedom to choose the Web Services that they need. Instead of re-inventing the wheel for each client, you need only include additional application-specific business logic on the client-side. This allows you to develop services and/or client-side code using the languages and tools that you want. Reusability - Web Services provide not a component-based model of application development, but the closest thing possible to zerocoding deployment of such services. This makes it easy to reuse Web Service components as appropriate in other services. It also makes it easy to deploy legacy code as a Web Service. Deploy ability - Web Services are deployed over standard Internet technologies. This makes it possible to deploy Web Services even over the firewall to servers running on the Internet on the other side of the globe. Also thanks to the use of proven community standards, underlying security (such as SSL) is already built-in.

78060105 Services Latest Technology

Web

Disadvantages:

Although the simplicity of Web services is an advantage in some respects, it can also be a hindrance. Web services use plain text protocols that use a fairly verbose method to identify data. This means that Web service requests are larger than requests encoded with a binary protocol. The extra size is really only an issue over low-speed connections, or over extremely busy connections. Although HTTP and HTTPS (the core Web protocols) are simple, they weren't really meant for long-term sessions. Typically, a browser makes an HTTP connection, requests a Web page and maybe some images, and then disconnects. In a typical CORBA or RMI environment, a client connects to the server and might stay connected for an extended period of time. The server may periodically send data back to the client. This kind of interaction is difficult with Web services, and you need to do a little extra work to make up for what HTTP doesn't do for you. The problem with HTTP and HTTPS when it comes to Web services is that these protocols are "stateless"the interaction between the server and client is typically brief and when there is no data being exchanged, the server and client have no knowledge of each other. More specifically, if a client makes a request to the server, receives some information, and then immediately crashes due to a power outage, the server never knows that the client is no longer active. The server needs a way to keep track of what a client is doing and also to determine when a client is no longer active. Typically, a server sends some kind of session identification to the client when the client first accesses the server. The client then uses this identification when it makes further requests to the server. This enables the server to recall any information it has about the client. A server must usually rely on a timeout mechanism to determine that a client is no longer active. If a server doesn't receive a request from a client after a predetermined amount of time, it assumes that the client is inactive and removes any client information it was keeping. This extra overhead means more work for Web service developers.

78060105 Services Latest Technology

Web

9. Implementing Web Services


Here is a brief step-by-step on how a Web service is implemented.

A service provider creates a Web service The service provider uses WSDL to describe the service to a UDDI registry The service provider registers the service in a UDDI registry and/or ebXML registry/repository. Another service or consumer locates and requests the registered service by querying UDDI and/or ebXML registries. The requesting service or user writes an application to bind the registered service using SOAP in the case of UDDI and/or ebXML Data and messages are exchanged as XML over HTTP

10.

Web Services Infrastructure

Even though Web services are being built using existing infrastructure, there exists a strong necessity for a number of innovative infrastructures. The core architectural foundations of Web services are XML, XML namespaces, and XML schema. UDDI, SOAP, WSDL, ebXML and security standards are being developed in parallel by different vendors

11.

Web Services Technologies and Tools

There are a number of mechanisms for constructing Web services. Microsoft has come out with a new object-oriented language C# as the development language for Web services and .NET framework. Microsoft has an exciting tool called Visual Studio .NET in this regard. The back end database can be Microsoft SQL Server 2000 in Windows 2000 Professional. Sun Microsystems has its own set of technologies and tools for facilitating Web services development. Java Servlets, Java Server Pages (JSPs), Enterprise JavaBeans (EJB) architecture and other Java 2 Enterprise Edition (J2EE) technologies play a very critical role in

10

78060105 Services Latest Technology

Web

developing Web services. There are a number of tools for developing Web services. They are Forte Java IDE, Oracle JDeveloper, and WebGain Studio. Sun Microsystems has taken an initiative called Sun ONE (Open Network Environment) and is planning to push Java forward as a platform for Web services. It is developing Java APIs for XML-based remote procedure calls and for looking up services in XML registries two more JAX family APIs: JAX/RPC (Java API for XML Remote Procedure Calls) and JAXR (Java API for XML Registries). These will wrap up implementations of Web services standards, such as SOAP and UDDI. IBM also for its part has already developed a suite of early-access tools for Web services development. They are Web Services Toolkit (WSTK), WSDL Toolkit, and Web Services Development Environment (WSDE). Apache Axis is an implementation of the SOAP (Simple Object Access Protocol) submission to W3C. From the draft W3C specification: SOAP is a lightweight protocol for exchanging structured information in a decentralized, distributed environment. It is an XML based protocol that consists of three parts: an envelope that defines a framework for describing what is in a message and how to process it, a set of encoding rules for expressing instances of application-defined data types, and a convention for representing remote procedure calls and responses. Apache Axis is an Open Source SOAP server and client. SOAP is a mechanism for inter-application communication between systems written in arbitrary languages, across the Internet. SOAP usually exchanges messages over HTTP: the client POSTs a SOAP request, and receives either an HTTP success code and a SOAP response or an HTTP error code. Open Source means that you get the source, but that there is no formal support organization to help you when things go wrong.

11

78060105 Services Latest Technology

Web

Reference: http://www.mono-project.com http://livedocs.adobe.com http://social.msdn.microsoft.com/Forums http://www.j2eebrain.com http://www.tutorialspoint.com

12

You might also like