• Save
Apachecon 2009
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Apachecon 2009

on

  • 901 views

An easy way to learn Axis2. A talk at ApacheCon US 2009.

An easy way to learn Axis2. A talk at ApacheCon US 2009.

Statistics

Views

Total Views
901
Views on SlideShare
901
Embed Views
0

Actions

Likes
0
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Apachecon 2009 Presentation Transcript

  • 1. Quick Start Axis2 By Deepal Jayasinghe [ [email_address] ] Georgia Institute of Technology And Apache Software Foundation
  • 2. Who am I ?
    • Present :
      • Graduate Student at Georgia Tech
      • Apache Member
      • PMC member Web service and Synapse
    • Past :
      • Member at WSO2.
    • Axis2 developer since day one.
  • 3. Agenda
    • Web service in one line
    • POJO
    • Service Archive
    • Axis2 clients
    • Axis2 session example
    • Service extension – Module
    • Pluggable components
    • Tools
    • REST
    • Let's Fly on Cloud ...
  • 4. Presentation Resources
    • http://people.apache.org/~deepal/ac_us_09
  • 5. Axis2 POJO
    • Deploy and Start Web Service in one line
    • Deploy POJO
    • Invoke it in REST manner
  • 6. POJO Deployment
    • Write a Java class
    • Compile it
    • Deploy into repository/pojo directory
    • Has limited control
    • A few issues when there are multiple classes
  • 7. Axis2 Archive
    • Why do we need it ?
    • What can we have inside an archive ?
  • 8. Axis2 Client API
    • There are two main APIs (Do it hard way, but more flexible)
      • ServiceClient
      • OperationClient
    • Let's find an easy way
      • RPCServiceClient
      • Code generation
  • 9. ServiceClient APIs
    • ServiceClient has the following set of APIs
      • SendRobust
      • FireAndForget
      • SendReceive
      • SendReceiveNonBlocking
  • 10. Adding Custom SOAP Headers
    • There are three main ways of adding a header
      • Adding as a string header
        • addStringHeader(QName headerName, String headerText)
      • Adding as a SOAP header block
        • addHeader(SOAPHeaderBlock header)
      • Adding as an AXIOM element
        • addHeader(OMElement header)
  • 11. What is Option object?
    • Option object is used to configure the client
    • HTTP properties
      • Chunking
      • Proxies
      • Authentication (NTLM, Basic, Digest)
      • Timeouts (Socket, Connection)
      • Support GZIP
      • HTTP Headers, etc
    • WS-Addressing properties (wsa:to , was:replyTo)
    • Generic properties (name, value pairs)
  • 12. Asynchronous Invocation
    • There are two types
      • Application level
      • Transport level
    • Uses the callback mechanism
    • Provides the implementation object of AxisCallback, which has the following methods
      • OnMessage
      • OnFault
      • OnError
      • onComplete
  • 13. Dynamic Client
    • Creating a client on the fly
    • No need to provide an option object
    • Can use either ServiceClient or RPCServiceClient
    • ServiceClient client = new ServiceClient(null,new URL(" http://localhost:8080/axis2/services/EchoService?wsdl "),null,null);
    • OMElement response =client.sendReceive(newQName("http://ws.apache.org/axis2","sayHello"),null);
  • 14. Create a Client Using a WSDL
    • First ensure you have
      • SET AXIS2_HOME=c:axis2-1.5
      • or similar (EXPORT, SETENV, etc)
    • Command-line tool:
      • wsdl2java.bat -uri http://localhost:8090/axis2/services/SampleService?wsdl -o H:Axis2-tutorialac-us-2009codegen
    • Generates
      • Ant Build script – build.xml
      • srcEchoServiceStub.java
  • 15. Client-side Session Handling
    • ServiceClient supports invoking a service in a session aware manner
      • In the case of a SOAP session, it will copy the required reference parameter
      • In the case of a transport session, it will copy the HTTP cookies
    • Axis2, by default, copies the JSESSION cookie ID
    • If you want to change a custom cookie, then we need to specify the cookie name
    • options.setProperty(“customCookieID”,”SESSIONID”);
  • 16. Session Aware Service
    • There are four types
      • Application
      • Transport
      • SOAP Session
      • Request
    • Specifying a service scope
    • <service scope=”application”> </service>
    • Accessing contexts
  • 17. Adding a Web Resource
    • Services can be deployed alone with a web resource (jsp , js , html etc)
    • When we have a web resource, we have to put them under the directory called 'WWW'
    • META-INF
    • services.xml
    • WWW
    • index.html
    • Upon deployment, you can access the resource using (if the service archive name is foo.aar)
      • http://localhost:8080/axis2/foo
  • 18. Axis2 Module
    • Modules are how Axis2 extends or provides quality of services
    • Implementation of WS-Specification
    • Can add support for a new specification in a simple and clean manner
    • Can deploy as a self contained package
    • Has own class loader module, so the module is also isolated
  • 19. Axis2 Code Generation
    • There are many options for data binding frameworks
      • ADB
      • XMLbeans
      • JaxBri
      • JibX
    • We can easily add a new data biding framework
  • 20. Axis2 Pluggable Components
    • Extending Axis2 deployment
      • Custom deployers
    • Axis2 observers
      • Listen to Axis2 events
    • Custom message receivers
      • Talking to non-java class
    • Adding a new transport
  • 21. Writing Our Own Deployer
    • There are a few things when developing a new deployer
      • How to make something into an Axis2 component
        • Service, Module or anything else
      • How to remove that
      • How to populate an object correctly
    • As an exercise, write a deployer to make a pure Java class into a service
  • 22. Axis2 Observers
    • Observing what happened inside AxisConfiguration
      • Adding service
      • Changing service
      • Adding module
      • Changing module
    • Observer will notify when the above events happen
    • Then the observer can act upon that
      • WSO2 WASA atom and RSS feed generation
  • 23. Custom Message Receivers
    • A message receiver is MEP dependent
    • A message receiver can be considered as the last handler of the in chain
    • You can write a Message receiver
      • Invoke non Java class
        • Java Script , Groovy etc...
      • As a service
        • You can deploy a service only with a MR
  • 24. Adding a New Transport
    • Adding a new transport framework is just a matter of
      • Creating a TransportSender
      • Creating a TransportReceiver
      • Registering them in axis2.xml
  • 25.  
  • 26. Want to Contribute ?
    • Join axis-user and axis-dev list
    • Pick a JIRA and fix it
    • Send patches we will give you the commitership :)
  • 27. Resources
    • Axis2 official web site
      • http://ws.apache.org/axis2
    • Presentation material
      • http://people.apache.org/~deepal/ac_us_09