Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

LBIA Internal Training Introduction to Web Services

Srinivasan Ramjee Aug 21, 2009

Agenda

Introduction Architecture WSDL SOAP Some Other Aspects of WLS Web Services Implementation using WebLogic Consumption SoA Q&A

-2-

Document Name CONFIDENTIAL

Introduction
What is Web Service? A Web Service is a software system designed to support interoperable machine-to-machine interaction over a network. It has an interface described in a machine-processable format (specifically WSDL). Other systems interact with the WebService in a manner prescribed by its description using SOAP messages, typically conveyed using HTTP with an XML serialization in conjunction with other Web-related standards. - W3C Definition of Web Service Why use Web Service? As Web-application lets people access it without platform hindrance, Web Services lets interoperable programmatic access over web. Where to implement Web Service? In places where an application interface would benefit if made platform independent.

-3-

Document Name CONFIDENTIAL

Architecture

-4-

Document Name CONFIDENTIAL

Web Services Description Language


WSDL is a document describing the Web Service to consumers It is an XML document, with standard semantics, that can be pulled via Http and understood by people/program It defines the operation and message in an abstract way and binds to a concrete network protocol and message format to define an endpoint Without WSDL it would have been more off-line communication approach between the provider and consume WSDL has four transmission primitives that an endpoint can support:
One-way. The endpoint receives a message Request-response. The endpoint receives a message, and sends a correlated message Solicit-response. The endpoint sends a message, and receives a correlated message Notification. The endpoint sends a message

WSDL Schema Elements Types - a container for data type definitions using some type system Message - an abstract, typed definition of the data being communicated Operation - an abstract description of an action supported by the service Port Type - an abstract set of operations supported by one or more endpoints Binding - a concrete protocol and data format specification for a particular port type Port - a single endpoint defined as a combination of a binding and a network address Service - a collection of related endpoints

-5-

Document Name CONFIDENTIAL

Simple Object Access Protocol


SOAP provides the definition of the XML-based information which can be used for exchanging structured and typed information between peers in a decentralized, distributed environment It is fundamentally a stateless, one-way message exchange paradigm, but applications can create more complex interaction patterns A SOAP message is fundamentally a one-way transmission between SOAP nodes, from a SOAP sender to SOAP receiver SOAP has the structure SOAP Envelop Header Body Server side exceptions is put in as Fault element under Body Transport, as defined in WSDL, can be HTTP JMS SMTP

-6-

Document Name CONFIDENTIAL

Some Other Aspects of WLS Web Services


Security - To secure your WebLogic Web Service, you configure one or more of three conceptually different types of security:
- Message-level security, in which data in a SOAP message is digitally signed or encrypted - Transport-level security, in which SSL is used to secure the connection between a client application and the Web Service - Access control security, which specifies which users, groups, and roles are allowed to access Web Services

Reliable SOAP Messaging


- Reliable SOAP messaging is a framework whereby an application running in one WebLogic Server instance can asynchronously and reliably invoke a Web Service running on another WebLogic Server instance - Reliable is defined as the ability to guarantee message delivery between the two Web Services - WebLogic runtime saves the message in its persistent JMS store. The store can be either a JMS File or JDBC store

UDDI Registry (Universal Description, Discovery and Integration)


- The UDDI Project is an industry initiative that is working to enable businesses to quickly, easily, and dynamically find and carry out transactions with one another - A populated UDDI registry contains cataloged information about businesses, the services that they offer and communication standards and interfaces they use to conduct transactions - The UDDI 2.0 Server is part of WebLogic Server

-7-

Document Name CONFIDENTIAL

Implementation with WebLogic 8.1


Two approaches are Starting from Java
From Java Class From stateless Session EJB

Starting with WSDL wsdl2Service is an Ant task which takes as input an existing WSDL file and generates the Java interface that represents the implementation of your Web Service optionally, an empty Java implementation class the web-services.xml file that describes the Web Service

servicegen is a WebLogic provided ant task for generating the service. It does Introspects the Java code, looking for public methods to convert into Web Service operations and non-built-in data types used as parameters or return values of the methods. Creates a web-services.xml deployment descriptor file, based on the attributes of the servicegen Ant task and introspected EJB or Java class information. Optionally creates the serialization class that convert the non-built-in data between its XML and Java representations. It also creates XML Schema representations of the Java objects and updates the web-services.xml file accordingly. Packages all the Web Service components into a Web application WAR file, then packages the WAR and EJB JAR files into a deployable EAR file.

Certain Java data types, if used as parameters or return values of a method that implements a Web Service operation, are automatically transported as SOAP Attachments (rather than elements in the SOAP body) when going over the wire.

-8-

Document Name CONFIDENTIAL

Implementation with WebLogic 9.2


WebLogic Web Services are implemented according to the Enterprise Web Services 1.1 specification, which defines the standard J2EE runtime architecture for implementing Web Services in Java EWS 1.1 describes packaging format, deployment model, and runtime services WebLogic Web Services are based on JWS files (Java files that use JWS annotations to specify the shape and behaviour of the Web Service) and Ant tasks that execute on the JWS file Web Services development methodologies Starting with Java Starting with WSDL jswc is a WebLogic provided ant task which will build the Web Services in a standard web application WAR file, with additional artifacts, such as webservices.xml and weblogic-webservices.xml deployment descriptor file, the JAX-RPC data type mapping file, the WSDL, and so on Multiple JWS files can either be packaged as a single WAR file or as multiple WAR files through parameter to jswc task Over basic Web Services, you can program and configure additional advanced features such as WS-ReliableMessaging, WS-Security, WS-Policy, ...

-9-

Document Name CONFIDENTIAL

Web Services Client


WSDL analysis is the step zero for Web Service consumer WebLogic implements JAX-RPC 1.1, which defines the APIs used to invoke a WS A web browser can generate a client request In Java world a client can be Stand-alone client application J2EE component running in an Application Server WebLogic clientgen ant task generates JAX-RPC client stub archive from WSDL Handle java.rmi.RemoteException and javax.xml.rpc.ServiceException

- 10 -

Document Name CONFIDENTIAL

SoA
SoA represents a fundamental shift in the way new applications are designed, developed, and integrated. It also greatly facilitates the development of enterprise applications as modular business services that can be easily integrated and reused. Three basic steps behind SoA Building a Portfolio of re-usable Services Wiring through Enterprise Service Bus Orchestrating into an End-to-End process

- 11 -

Document Name CONFIDENTIAL

Document Name CONFIDENTIAL

Thank You!

You might also like