Service Oriented Architecture
It is an evolution of the fundamentals governing a component based development. Component based development provides an opportunity for greater code reuse than what is possible with object oriented principles.
Web Service -- It is an implementation technology and one of the ways to implement SOA. We can build SOA based applications without using Web Services for example Java RMI, EJB, JMS. But what Web Services offer is the standard based and platform-independant service via HTTP, XML, SOAP, WSDL and UDDI, thus allowing interoperability between heterogenous technologies like J2EE and .Net. Web Services support loosely coupled connections. The interface of the Web service provides a layer of abstraction between the client and the server. The loosely coupled applications reduce the cost of maintenance and increases reusability. esent a new form of middleware based on XML and Web. Web services are language and platform independent. You can develop a Web service using any language and deploy it on to any platform, from small
device to the largest supercomputer. Web service uses language neutral protocols such as HTTP and communicates between disparate applications by passing XML messages to each other via a Web API.
SOAP stands for Simple Object Access Protocol. It is an XML based lightweight protocol, which allows software components and application components to communicate, mostly using HTTP (can use SMTP etc). SOAP sits on top of the HTTP protocol. SOAP is nothing but XML message based document with pre-defined format. SOAP is designed to communicate via the Internet in a platform and language neutral manner and allows you to get around firewalls as well. Let’s look at thr structure of a SOAP messages:
A SOAP message MUST be encoded using XML.
A SOAP message MUST use the SOAP Envelope namespace.
A SOAP message MUST use the SOAP Encoding namespace.
A SOAP message must NOT contain a DTD reference.
A SOAP message must NOT contain XML Processing Instruction.
WSDL stands for Web Services Description Language. A WSDL document is an XML document that describes how the messages are exchanged. Let’s say we have created a Web service. Who is going to use that and how does the client know which method to invoke and what parameters to pass? There are tools that can generate WSDL from the Web service. Also there are tools that can read a WSDL document and create the necessary code to invoke the Web service. So the WSDL is the Interface Definition Language (IDL) for Web services.
UDDI stands for Universal Description Discovery and Integration. UDDI provides a way to publish and discover information about Web services. UDDI is like a registry rather than a repository. A registry contains only reference information like the JNDI, which stores the EJB stub references. UDDI has white pages, yellow pages and green pages. If the retail industry published a UDDI for a price check standard then all the retailers can register their services into this UDDI directory. Shoppers will search the UDDI directory to find the retailer interface. Once the interface is found then the shoppers can communicate with the services immediately.
Now, we have some java related API's for web services. The J2EE 1.4 platform provides comprehensive support for Web services through the JAX-RPC (Java API for XML based RPC Remote PCall)) and JAXR (Java API for XML Registries). In the J2EE 1.4 platform you can but the above mentioned XML based standards and protocols. A Web service client accesses the EJB container.
JAX-RPC (Java API for XML based RPC) supports XML based RPC for Java and J2EE platforms. JAX-RPC provides an easy to develop programming model to develop Web services. As shown in the diagram above, a JAX-RPC runtime system and API abstracts the complexities of SOAP protocol by :
Providing a standard way of marshalling Java to XML and Java to WSDL and unmarshalling XML to Java and WSDL to Java.
Standardizing the creation of SOAP requests and responses.
Supporting and dispatching SOAP requests to methods on JAX-RPC Service Endpoint classes in the Web Container.
Specifying a standard way to plug in SOAP message handlers, allowing both pre and post processing of SOAP requests and responses.
The JAX-RPC message handlers are similar to servlet filters. They provide additional message-
handling facilities to Web service endpoints (both client and server) as extensions to the basic service implementation logic by providing logging, auditing, encryption, decryption etc.
Apache AXIS is a Web services tool kit, which enables you to expose a functionality you have as a Web service without having to learn everything there is to know about the underlying platform. It hides all the complexities from the developer and improves productivity.
No comments:
Post a Comment