wood burning stoves 2.0*
The moose likes Web Services and the fly likes Using WS-RM with Axis2 1.5? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Using WS-RM with Axis2 1.5?" Watch "Using WS-RM with Axis2 1.5?" New topic
Author

Using WS-RM with Axis2 1.5?

Karl Beowulph
Ranch Hand

Joined: May 31, 2004
Posts: 130
Hello,

We've recently made a switch from building WS clients in JBossWS to using Axis2. Can anyone point me to a quick guide on building WS-RM clients in Axis2?

I'm aware of the Sandesha2 module for Axis2 which is supposed to handle WS-RM, but the last version is from 2007 and claims compatibility with Axis2 1.3. Is it still useable with later versions?
Karl Beowulph
Ranch Hand

Joined: May 31, 2004
Posts: 130
This has been giving me more problems then I anticipated...

I have a WS-RM enabled web service up and running in JBoss, the code is as follows:



I am able to connect to it without problem with a JBossWS client.



With my Axis2 client though, things are pretty wonky. For a start, it looks like Sandesha2 [1.3] is not fully compatible with Axis2 [1.5], so I don't know how much of the problem is really a fault of my code vs. incompatibilities. I installed Sandesha2 as outlined, with the exception that I did not change my $AXIS2_HOME/conf/axis2.xml file (it already has RMPhase's in the phase orders).

I built my Axis client as such:


This attempt fails and I get the following in my axis.log


Anyone have any insight as to what I'm doing incorrectly in Axis2?
Karl Beowulph
Ranch Hand

Joined: May 31, 2004
Posts: 130
A bit more reading has turned up that JBossWS implements WS-RM 1.1. I've also updated my Sandesha2 to version 1.5 RC1.

I've changed my client accordingly:



I still have errors though. My axis.log reads as such:


Skimming through the console output, I found the following:

Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
I guess you don't want to know that when using Metro, you just drop in some libraries and the client will use reliable messaging, without any additional coding.
Well, hopefully this information can help other people when about to chose web service stack.
Best wishes!
Karl Beowulph
Ranch Hand

Joined: May 31, 2004
Posts: 130
Howdy,

Thanks Ivan, but the decision to use Axis2 comes from above me, so no changing that one.

After bit more investigation, it looks like the XML requests being sent to the JBoss AS are different.

JBossWS client request (works)


Axis2 client request (does not work)


So it looks like JBoss AS accepts CreateSequence, but not MakeConnection.
Karl Beowulph
Ranch Hand

Joined: May 31, 2004
Posts: 130
Getting closer I think. I'm able to have Axis2 generate the following request:



And this almost works; if I change the replyTo address (through TCPMON) to "http://www.w3.org/2005/08/addressing/anonymous" instead of "http://docs.oasis-open.org/ws-rx/wsmc/200702/anonymous" I get a response instead of an error. Unfortunately, I can't figure out how to change the reply-to address within the code. I tried clientOptions.setReplyTo(new EndpointReference("http://www.w3.org/2005/08/addressing/anonymous"));, but that didn't change anything. Any ideas?
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
I just want to say that even though I do not use Axis2, it is interesting to read about your progress and I appreciate you sharing this information.
Best wishes!
Karl Beowulph
Ranch Hand

Joined: May 31, 2004
Posts: 130
Solved, more-or-less.

The problem was that the setReplyTo method actually was working, it was, however, being overriden by SandeshaUtil.java (starting at line 1108). This was corrected by disabling the anon URI.

Now the service/client actually works, but not perfectly. I get the right response, but for some reason, about 20% the time, a non-interruptive error is still thrown (I still get the result I want, but there are errors regardless).



The error shown in the JBoss AS output:


With it working I'm content with leaving it as is. Ideally I'd like to figure out why JBoss is not able to process the original "http://docs.oasis-open.org" addressing URL and throwing the 20% WS-RM error, but I don't think I'm going to have the luxury of time to do so.
Sathees Tharmarajah
Greenhorn

Joined: Aug 09, 2009
Posts: 20
HI Karl Beowulph

I appreciate you


sathees
Karl Beowulph
Ranch Hand

Joined: May 31, 2004
Posts: 130
Thanks Sathees.

Now on to the next problem, figuring out how to allow Axis2/Sandesha2 to work with long ( > 10 seconds) operations. Once again, this is something that just works with JBossWS (which, regardless of ease-of-use, has its own gotchas).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using WS-RM with Axis2 1.5?
 
Similar Threads
jax-ws client different between axis2 eclipse and wsimport.
SpringWS Client for Axis2 webservices
Asynchronous Web service call
Can Sandesha2 service close sequence??
Migration from Axis framework to JAX-WS framework