You are on page 1of 16

Introduction to JAVA Web Services

SpringPeople Software Private Limited, All Rights Reserved.

What are Web Services?


Web Services are used to build interoperable distributed services across different platform. The client and server can be developed on different platforms and in different languages, yet they can exchange requests and responses. For example, a Java client can consume a .NET based service and viceversa Legacy or new systems can be integrated rather easily by exposing them as web services. A better ROI from every system can be achieved.

SpringPeople Software Private Limited, All Rights Reserved.

Typical Distributed Architecture

SpringPeople Software Private Limited, All Rights Reserved.

Distributed Architecture Examples


Java Platform RMI (Remote Method Invocation), EJB (Enterprise Java Beans), CORBA, now not so famous
@Remote interface as the interface @SessionBean as implementation JNDI Directory as the registry JBoss as the service container & publisher InitialContext.lookup() for fetching proxy on the client side

COM/DCOM on Microsoft platform

SpringPeople Software Private Limited, All Rights Reserved.

Major Shortcomings of Distributed System


Both client and server must be on the same platform
Clients on other platforms can not utilize the services Changes in server-side environment affect all the clients

Client must have server side API for interaction


Client can not be developed unless the API is distributed Often the API may be priced, poorly documented and etc.,

The protocol between client and server is also platform specific and often proprietary
Client that wants to connect to several remote objects have to implement all the specified protocols

SpringPeople Software Private Limited, All Rights Reserved.

Web Service Architecture Solution

SpringPeople Software Private Limited, All Rights Reserved.

Web Services Standards


Web Services are build on three foundation standards Web Service Definition Language (WSDL): An XML based IDL to describe the service definitions in a language agnostic way Service Oriented Architecture Protocol (SOAP): An XML based PDU for communication between the clients and services Universal Description Discovery and Integration (UDDI): An XML based registry for service publication and discovery Bodies like OASIS proposed and publicized other standards as well Standards like WS-Address, WS-Security, WS-Authentication and etc., are built on top of foundation standards

SpringPeople Software Private Limited, All Rights Reserved.

Web Service Definition Language (WSDL)


What is WSDL? Its an IDL for describing a web service interface. The service is meant for the clients of any platform. Its XML based. Who develops them? WSDL is hand-written in Contract-First Approach WSDL is generated in Contract-Last Approach
SpringPeople Software Private Limited, All Rights Reserved.

What WSDL consists of?


An abstract section Types: Describes the XML types & elements that are used in the messages to/from the web services. Messages: Describes the input, output and fault messages that comes into and goes out of web service operations. PortType: Names the web service and describes the operations offered by the web service A concrete section Bindings: Describes the transport protocol like HTTP to carry the SOAP envelope for communicating with web service. Service: Describes the endpoint where the service is really available for consumption

SpringPeople Software Private Limited, All Rights Reserved.

SOAP/XML
What is SOAP? It stands for Service Oriented Architecture Protocol in the SOA/Web Services combination.
It originally stood for Simple Object Access Protocol when web services were merely meant for lightweight RPC calls.

What is its job? It carries the payload for request/response between the client and the server.
Obviously its an XML document (JSON is also supported)

SpringPeople Software Private Limited, All Rights Reserved.

Who writes and consumes SOAP/XML?


Web Service clients/servers dynamically prepares and consumes the SOAP envelopes

SpringPeople Software Private Limited, All Rights Reserved.

Who carries SOAP and what it consist of?


HTTP or protocol (as specified in WSDL) carries it It consists of optional Header and mandatory Body

SpringPeople Software Private Limited, All Rights Reserved.

Web Services v/s SOA


Web Services is one of the technologies to implement Service Oriented Architectures (SOA) However, Web Services predates SOA. Primary intention of web services was to make RPC calls, later it became a technology of choice for SOA implementation Clients can be developed as an orchestration of services from various endpoints that confirms to SOA Business processes can be delivered in accordance with Software As A Service (SAAS) paradigm. Services needs not be installed at client site, they are just consumed.

SpringPeople Software Private Limited, All Rights Reserved.

Become a Web Services Expert In 3 Days Flat

Attend the 3-Days Web Services Workshop

View Complete Details

SpringPeople Software Private Limited, All Rights Reserved.

Who will benefit?

Developers and Programmers, who wish to build interoperable distributed services across different platform.

View Complete Details

SpringPeople Software Private Limited, All Rights Reserved.

Q&A
training@springpeople.com +91 80 65679700 www.springpeople.com

A SpringSource Certified Partner and


VMware Authorized Training Center

SpringPeople Software Private Limited, All Rights Reserved.

You might also like