WSDL Tutorials - Herong's Tutorial Examples - Version 2.03, by Dr. Herong Yang
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"); request.addChild(guest);
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
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
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
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
Axis2RegistrationClient.java - document/literal Style
Axis2GetSpeechClient.java - document/literal Style
org.apache.axis2.rpc.client.RPCServiceClient Class
Axis2GetExchangeRateClient.java - rpc/encoded Style
SocketRequestResponseServer.java - 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