Integration Approach - PowerPoint PPT Presentation

1 / 23
About This Presentation
Title:

Integration Approach

Description:

Need to provide access to selected services to clients ... Add in axis libraries to the classpath. Modify web.xml to include AXIS servlet ... – PowerPoint PPT presentation

Number of Views:21
Avg rating:3.0/5.0
Slides: 24
Provided by: let7
Category:

less

Transcript and Presenter's Notes

Title: Integration Approach


1
  • Integration Approach
  • AXIS-SOAP
  • Web Services

2
Agenda
  • Web Services
  • SOAP
  • Apache-AXIS
  • Demonstration

3
Web Services
  • Problem
  • Need to provide access to selected services to
    clients
  • Want to avoid exposing the business logic from
    the client

4
Web Services
  • Web accessible, client-service architecture.
  • server side offers a clear interface while hiding
    business logic
  • client side coding is clients responsibility

Web Server
Business Logic
Client
Servlet
5
Web Services
  • Issues
  • Providing implementation independent transport
  • Publishing the interface

6
SOAP
  • Simple Object Access Protocol (SOAP)
  • Defines a protocol for the exchange of messages
    (usually over HTTP)
  • Platform independent
  • Extensive use of XML Namespaces
  • Format
  • Requires use of xmlnsSOAP
  • SOAPEnvelope
  • SOAPHeader
  • SOAPBody

7
SOAP
  • SOAP Sample
  • lt?xml version"1.0"?gt
  • ltsoapEnvelope xmlnssoap"http//www.w3.org/2001/
    12/soap-envelope" soapencodingStyle"http//www.w
    3.org/2001/12/soap-encoding"gt
  • ltsoapHeadergt
  • ... ...
  • lt/soapHeadergt
  • ltsoapBodygt
  • ...
  • lt/soapBodygt
  • lt/soapEnvelopegt

8
SOAP
  • Client sends out SOAP encode service request
  • ltsoapbodygt
  • ltns1AXISIntegrationgt
  • ltisPartOfOutagegt
  • ltqueryIDgt12345678lt/queryIDgt
  • lt/isPartOfOutagegt
  • lt/ns1AXISIntegrationgt
  • lt/soapbodygt

9
SOAP
  • Server recieves the SOAP encoded request
  • Extracts the body of the message
  • Executes the necessary business logic
  • Replies with a SOAP encoded response
  • ltsoapbodygt
  • ltns1AXISIntegrationgt
  • ltisPartOfOutageResponsegt
  • response object
  • lt/isPartOfOutageResponsegt
  • lt/ns1AXISIntegrationgt
  • lt/soapbodygt

10
Apache-AXIS
  • SOAP Engine
  • Publishes webservice interfaces
  • Automatic SOAP encoding/decoding
  • Automatic Object serialization/deserialization
  • Automatic code generation from interfaces

Server Side AXIS
Client Side AXIS
Service
WebServer
Client
11
AXIS
  • Server Side Architecture
  • Resides on the server as a servlet (web.xml)

User defined Services
AXIS Servlet
Server-config.wsdd
.wsdl
12
AXIS
  • Server Side Architecture
  • Services are deployed by mappings in the
    server-config.wsdd
  • Listens for requests to mapped services invokes
    the appropriate code
  • Services are published by an automatically
    generate (or predefined) Web Services Description
    Language (WSDL) file
  • Modified either manually or via AXIS Admin
    deployment tool

13
AXIS
  • .wsdd sample (part of server-config.wsdd)
  • ltservice name"AXISIntegrationServlet"
    provider"javaRPC"gt
  • ltparameter name"className" valueltservlet
    classgt"/gt
  • ltparameter name"allowedMethods" value""/gt
  • lttypeMapping xmlnsnsltcustom type mappinggt
  • serializerltcustom serializergt
  • deserializerltcustom deserializergt
  • ltwsdlFilegtcustom wsdl filelt/wsdlFilegt

14
AXIS
  • .wsdl sample
  • lt?xml version"1.0" encoding"UTF-8"?gt
  • ltwsdldefinitions
  • ltwsdltypesgt
  • types defined as XML Schemas
  • ltwsdlmessage name"isPartOfOutageRequest"gt
  • messages their contents definitions
  • ltwsdlportType name"AXISIntegrationServlet"gt
  • ...binding port types
  • ltwsdlbinding name"AXISIntegrationServletSoapBin
    ding" type"implAXISIntegrationServlet"gt
  • ..binding messages to servlets
  • ltwsdlservice name"AXISIntegrationServletServic
    e"gt
  • .. bind services to addresses

15
AXIS
  • Automatically (De)Serializes simple types from
    XML to Objects (and vice versa)
  • Complex types require custom (De)Serializers
  • Complex Type (De)Serialization
  • Create custom (De)Serializer for the type
  • Map the object to that (De)Serializer
    (server-config.wsdd)

16
AXIS
  • Client Side Architecture
  • Automatic (De)Serialization
  • AXIS stub generation from server provided wsdl

(De)Serializers
AXIS Generated Code
Webservice Consumer
17
AXIS
  • In relation to eRespond
  • Reside as a servlet on the webserver
  • Add in axis libraries to the classpath
  • Modify web.xml to include AXIS servlet
  • Check provided eRespond/axis.htm

18
AXIS Development
  • General steps for development
  • Write deploy service class
  • Define the.wsdd for that service
  • if necessary define custom .wsdl types place on
    the classpath
  • deploy the service (modify server-config.wsdd
    manually or via AXIS Admin tool)
  • redeploy webapp

19
AXIS Development
  • Demonstation service is Part Of Outage
  • Recieves a long query premise id
  • Searches if the premise associated with that id
    is currently part of an Outage
  • If so returns details of that outage
  • If not returns null

20
AXIS Development
  • Created AXISIntegrationServlet.java
  • Implemented method isPartOfOutage(long queryID)
  • public Outage isPartOfOutage(long queryID)
  • Long query new Long(queryID)
  • Outage retOutage null
  • creating the actionObjectInterface
  • retOutage (Outage) actionObjectInterface.proces
    sMessage(query)
  • return retOutage

21
AXIS Development
  • Defined .wsdl for method and type Outage
  • Created Custom (De)Serializers for type Outage
  • Defined .wsdd deployed to the server
  • Examined AXISIntegrationServlet?WSDL

22
AXIS Development
  • Client Side Development
  • Generated Classes using WSDL2Java
  • Mapped type Outage to custom (De)Serializers
  • Created service consumer code calling on
    generated classes
  • public static Outage getOutageFor(long queryID)
  • ..call on AXIS generated stubs
  • AXISIntegrationServlet test service.getAXISInteg
    rationServlet()
  • response test.isPartOfOutage(queryID)
  • return response

23
Conclusion
  • WebServices allow us to provide external access
    to selected services
  • SOAP enables client-server transport
  • AXIS Simplifies webservice development
    deployment with
  • Service Publishing via WSDL files
  • Automatic (De)Serialization
  • Client Side code generation
Write a Comment
User Comments (0)
About PowerShow.com