AXIOM (AXIs Object Model)

This section describes AXIOM (AXIs Object Model) that allows us to build and parse XML elements represented as AXIOM objects.

From the previous tutorial, I learned how to invoke the operation with the sendReceive() method. Now I need to learn how to create the SOAP Body element using AXIOM (AXIs Object Model).

AXIOM offers these methods to create OM element and sub elements.

1. Getting the default OM factory:

   OMFactory factory = OMAbstractFactory.getOMFactory();

2. Creating an OM namespace:

   OMNamespace namespace = factory.createOMNamespace(tns, "hy");

3. Creating an OM element:

   OMElement request 
      = factory.createOMElement("RegistrationRequest", namespace);

4. Adding an attribute to an OM element:

   request.addAttribute("event", "OpenGame", namespace);

5. Adding a sub element to an OM element:

   OMElement guest = factory.createOMElement("Guest", namespace);
   guest.setText("Herong Yang");

AXIOM offers these methods to parse OM elements.

1. Returning the local name of an OM element:

   name = response.getLocalName()

2. Returning the text content of an OM element:

   text = response.getText()

3. Returning the list of sub elements of an OM element:

   iterator = response.getChildElements()

4. Returning the list of attributes of an OM element:

   iterator = response.getAllAttributes()

Last update: 2009.

Table of Contents

 About This Book

 Introduction to WSDL 2.0

 WSDL 2.0 Document Structure and Syntax

 WSDL Version 2.0 Part 2: Adjuncts

 WSDL 2.0 Document Examples with SOAP Binding

 WSDL 20 Programming APIs and Testing Tools

 Introduction to WSDL 1.1

 WSDL 1.1 Document Structure and Syntax

 WSDL 1.1 Binding Extension for SOAP 1.1

 soapUI 3.0.1 - Web Service Testing Tool

 WSDL 1.1 and SOAP 1.1 Examples - Document and RPC Styles

 PHP SOAP Extension in PHP 5.3.1

 Using WSDL in Perl with SOAP::Lite 0.710

Using WSDL Document in Java with Axis2 1.4.1

 What Is Axis2?

 Downloading and Installing Axis2/Java 1.4.1

 org.apache.axis2.client.ServiceClient Class

 Creating Service Client with WSDL Document

 org.apache.axis2.client.Options - Operation Client Options

 sendReceive() Method - Invoking a Named Operation

 Turning Off the Chunked HTTP Flag

AXIOM (AXIs Object Model) - document/literal Style - document/literal Style

 org.apache.axis2.rpc.client.RPCServiceClient Class - rpc/encoded Style - Socket Server Testing Program

 Capturing the HTTP Request from an Axis2 Client Program

 Using WSDL2Java to Generate Web Service Stub Classes

 WSDL 1.1 Binding Extension for SOAP 1.2

 WSDL 1.1 and SOAP 1.2 Examples - Document and RPC Styles

 SOAP 1.2 Binding - PHP, Java and Perl Clients

 WSDL Related Terminologies


 PDF Printing Version