File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other Open Source Projects and the fly likes Axis2 - How to write client without using AXIOM API Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Axis2 - How to write client without using AXIOM API" Watch "Axis2 - How to write client without using AXIOM API" New topic

Axis2 - How to write client without using AXIOM API

Sam Gehouse
Ranch Hand

Joined: Jul 21, 2003
Posts: 281
I am using the post below for learning purses:

I would like to know how to write client code using the stubs etc. that get created WITHOUT using AXIOM API. I am familiar with Axis1.

My questions:

1. Can I write client code similar to Axis1 that does not require using AXIOM API?

2. Could anyone provide some example of doing so?

3. In Axis1, I can write client without importing any Axis1 specific class. An example of client code in Axis1 is similar to the following:

In the client code above for Axis1, I only need to call the corresponding Service and ServiceLocator class. I do not need to know any other class specific to Axis1.

Could you please provide similar example of doing so without using the AXIOM API?

I tried coding something similar to the following for Axis2 client:

The attempt to write the code above threw exception in invoke method as:

My services.xml is:

The method add is:

Integer add(int i, int j)

Is there any way to write client code (similar to Axis1) that does not involve AXIOM API? Please provide an example.

Last Question: In the generated wsdl, I see Soap11Binding and Soap12Binding for the single method add. Why are there two different bindings generated?

The generated wsdl is:

Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
This is maybe more basic than you'd like, but it's possible to write a SAAJ client without referencing any particular SOAP stack; an example of that is here.
I agree. Here's the link:
subject: Axis2 - How to write client without using AXIOM API
It's not a secret anymore!