contents
Introduction
Installing Axis-MORA
Publishing Web Services with Axis-Mora
How to run a service
How to deploy a service
Using WSDL with Axis-Mora
WSDL2Ws:Building service class, wrapper and type classes from WSDL
Handler API
FAQ
Welcome to axis-MORA !!! Axis-MORA is an open-source project at experimental level.
Axis-Mora is a server side java implementation of a SOAP engine. It reuses all the subsystems of Axis1.1 except deserialization part and introduces a new concept called "wrappers" that is used to eliminate reflection. If you are interested in what are the changes in axis-Mora please refer "Change-log"
Please send feedback about the axis-Mora to "axis-user@ws.apache.org". If you feel the code could use some new features or fixes, please get involved and lend a hand!
We welcome your participation in axis-Mora discussion at
"axis-dev@ws.apache.org".
Axis-Mora uses pull structure for parsing xml. It eliminates reflection using a concept called "wrappers". Essentially the deserialization part of Axis1.1 has been replaced to produce Axis-Mora. Therefore it keeps all the key features of axis such as flexibility, stability, component-oriented deployment, transport framework and while it shows improvements in following areas.
Binary is not available. Source can be downloaded from the repository. See build guide
Let's invoke a simple web service. You can get the code from samples/usergiude/example1/TestClient. We have the client as follows in
This program could be run as follows,
% java userguide.example1.TestClient Hello Sent :'Hello!', got :'Hello!' %
So what's happening here? On lines 21 and 22 we create new Service and Call objects. These are the standard JAX-RPC objects that are used to store metadata about the service to invoke. on line 15, we specify the soapAction header and on line 24 we set up the soapAction header. Actually we send the service name through the soapAction header. On line 27, we set up our endpoint URL - this is the destination for our SOAP message. On line 17 we define the operation (method) name of the Web Service and we set that operation on the line 23. on line 26 we specify the return type. And on line 28 we actually invoke the desired service, passing in an array of parameters - in this case just one String.
S
tep 1 : We should deploy the web service in Axis-Mora first.Open the "deploy.wsdd" in samples/services/Calculator/deploy.wsdd. It looks as follows.
<?xml version="1.0" encoding="UTF-8"?>
<deployment xmlns="http://xml.apache.org/axis/wsdd/"xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<service name="Calculator" provider="java:RPC">
<parameter name="allowedMethods" value="*"/>
<parameter name="className" value="services.calculator.CalculatorService"/>
</service>
</deployment>
The outermost element tells the engine that this is a WSDD deployment, and defines the "java" namespace. Then the service element actually defines the service for us. Using these <parameter> tags, we give various information about our services. The parameter "className" tells the Axis engine where to find wrapper class name( we'll go into more details later ) , and "allowMethods" tell the engine that any public method on that class may be called.
Copy the contents within the <deployment> tags.
Open build/webapps/axismora/WEB-INF/mora-server.wsdd. Paste it as a immediate child of the <deployment> tags of the mora-server.wsdd. The structure of the mora-server.wsdd should look as the following.
<deployment xmlns="http://xml ........>
<globalConfiguration>
....................
<service name="CalculatorService" provider="java:RPC">
...........................................
</service>
<transport name="http">
....................................................
</transport>
</deployment>
Now it is deployed.
Step 2: Client implementation of axis-Mora is not available. Client of Axis1.1 could be used to send SOAP request to Axis-MORA.You can get the Test Client from samples/userguide/example2/TestClient To execute the client program run the program.
The result : 5
Axis-Mora supports WSDL for getting the service information and other details. The tool WSDL2Ws takes the wsdl and and get the information and create the web service, wrapper and necessary type classes. These classes will be generated automatically by this tool.
You can find the WSDL2Ws tool in "org.apache.axismora.wsdl2ws.WSDL2Ws". The basic invocation form looks like this:
j
ava org.apache.axismora.wsdl2ws.WSDL2ws
- -o target output folder\n"
- -l target language (c|java|c++) default is java
- -i implementation style (struct|order|simple) default is struct
- -s (client|server|both)
we have a wsdl file named "ArrayCalc.wsdl" in the samples/userguide/example3 folder. So the command will be
% java org.apache.axismora.wsdl2ws.WSDL2Ws ArrayCalc.wsdl -s server -o./example3 -ljava
Then there will be three classes named
To make the service deployed you need to copy the below service tag and paste it in the mora-server.wsdd file.
<service name=="ArrayCalc" provider="java:RPC">
<parameter name="allowedMethods" value="*"/>
<parameter name="className" value=" userguide.example3.ArrayCalc"/>
</service>
To run this service users are expected to compile the generated classes and copy them in to the <tomcat-home>/webapps/axismora/WEB-INF/classes folder.
The handler API follows JAX-RPC and SAAJ specifications. The implementation supports the SAAJ completely and covers the JAX-RPC functionally.
1.1 Handler
Handlers do not implement the JAX-RPC Handler interface. They follow axis handlers.
The Handler should implements the org.apache.axismora.Handler interface. The invoke method will be called by the axis engine.
1.2 SOAP Message Handler
A SOAP message handler class is required to implement the org.apache.axismora.Handler interface. This handler gets access to the SOAP message (that carries either an RPC request or response in the SOAP Body element) from the org.apache.axismora.MessageContext.
1.3 GenericHandler
The org.apcahe.axismora.handlers.BasicHandler class is an abstract class that implements the Handler interface. Handler developers should typically subclass the BasicHandler class unless the Handler implementation class needs another class as its super class.
1.4 HandlerChain
The org.apache.axismora.HandlerChain represents an ordered list of handlers. All Elements in the HandlerChain are of the type org.apache.axismora.Handler.
1.5 HandlerInfo
The org.apache.axismor.handlers.HandlerInfo class represents the configuration data for a Handler. A HandlerInfo instance is passed in the Handler.init() method to initialize a Handler instance.