You are on page 1of 17

Web Services

Shobana Sivagnanam
© 2005 Accenture All Rights Reserved.
Agenda

• Introduction to Web Services


• Why Web Services?
• J2EE & Web Services
• Architecture

© 2005 Accenture All Rights Reserved. 2


Introduction

• Communication of remote components


• Communication via a neutral data description
language – XML

Web Service SOAP Web Services


Client xml xml Server

© 2005 Accenture All Rights Reserved. 3


Introduction
Simple Object Access Protocol (SOAP)

• RPC imposes security & Compatibility problem


• Information exchange via HTTP
• Language & platform independent
• Based on XML
• Get around Firewalls
• Developed based on W3C standards
• Simple & Extensible

© 2005 Accenture All Rights Reserved. 4


Introduction

Service Broker

UDDI

WSDL WSDL

A SOAP B
Web Services Requestor Service Provider

© 2005 Accenture All Rights Reserved. 5


Why Web Services?

1. HTTP over Port 80

2. SOAP
• Prior to SOAP, methods were adhoc
• Very few people knew RPC & similar APIs

3. Flexible
• Loose coupling between the Web Services and the
applications using the same

© 2005 Accenture All Rights Reserved. 6


Advantages
• Interoperability between various software applications
running on different platforms
• Open standards and protocols
• Protocols & data formats are text based. So easy for
developers to understand
• Utilizing HTTP
• Services and Software from different companies and
locations are utilized to provide an integrated service.
• Reusability of services and components

© 2005 Accenture All Rights Reserved. 7


Disadvantages

• Features like Transaction are in primitive stage


compared to mature distributed computing standards
like CORBA

• Poor performance compared to RMI, CORBA or DCOM


because of text based formats

• Since HTTP is used, firewall security measures can be


evaded

© 2005 Accenture All Rights Reserved. 8


J2EE & Web Services

• Java is very much compatible with XML

• J2EE enterprise platform has inbuilt capabilities like


connection pooling, security etc.,

• Saves time for Web Services programmer

• Existing JSP, Servlets and EJBs can be exposed as


Web Services

© 2005 Accenture All Rights Reserved. 9


J2EE & Web Services

WSDP (Web Services Development Pack)

• Tools to help create , test & deploy

• APIs for working with XML


 Document Oriented for working with XML docs
 Procedure oriented for implementation of remote
communication via XML based standards

© 2005 Accenture All Rights Reserved. 10


Document Oriented API

• JAXP (Java API for XML Processing)


Process and transform XML docs using DOM & SAX

• JAXB (Java Architecture for XML Binding)


API for mapping between XML elements and java objects

• SAAJ (SOAP with Attachments API for Java)


API to create and populate SOAP message

© 2005 Accenture All Rights Reserved. 11


Procedure Oriented API

• JAX - RPC (Java API for XML based Remote Procedure Call)
Enables us to build SOAP based applications with RPC
Method calls are encapsulated in SOAP messages

• JAXM (Java API for XML Messaging)


Enables applications to send and receive XML messages
Implements SOAP 1.1 Standard

• JAXR (Java API for XML Registries)


Allows to access different XML registries

© 2005 Accenture All Rights Reserved. 12


J2EE & Web Services
• JSP
 Presentation layer for Web Services
 Forward the request to the Servlet

• Servlet
 Entry point to a J2EE system for Web Services
 Create and process SOAP messages
 RPC router – Route the RPC call to EJB and handle
remote data

• EJB
 Encapsulates business logic

© 2005 Accenture All Rights Reserved. 13


Architecture

J2EE SERVER
UDDI

1
2 JSP
4
EJB 5

3 Database
Servlet
Web Services
Client

© 2005 Accenture All Rights Reserved. 14


Architecture
1. Looks up the business registry
2. Receives the WSDL file describing the service
3. Servlet listening for request receives SOAP
message and encapsulates the result in the
SOAP message before sending
4. Servlet calls the relevent EJB and receives
the result
5. EJB talks with the DB

© 2005 Accenture All Rights Reserved. 15


Web Services

References
• http://java.sun.com/webservices
• http://www.w3schools.com
• https://mylearning.accenture.com

© 2005 Accenture All Rights Reserved. 16


Web Services

Thank you

© 2005 Accenture All Rights Reserved. 17

You might also like