axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "robert lazarski" <>
Subject Re: [AXIS2] J2EE Support
Date Sat, 17 Jun 2006 12:12:49 GMT
On 6/16/06, Dennis Sosnoski <> wrote:
> robert lazarski wrote:
> > <snip>
> > Currently I'm integrating an EJB app with Axis2 - thankfully as any
> > tomcat / servlet container web layer would. However, I came very close
> > to having to implement these services as EJB, which would have
> > required either JAX-WS or Axis 1.x , as Axis2 just isn't an option.
> >
> >
> I'm puzzled by this statement, Robert. Why is Axis2 not an option? You
> just use the EJB interfaces to access the service classes, same as any
> other application using the EJBs.
>   - Dennis

I'm not 100% sure we are on the same page, so allow me to give an example -
in JBoss 4.0.x using JSWDP databinding and axis 1.x - a strange hybrid but
that's what JBoss supports:

        <!-- SoapSession is a stateful session bean -->

import javax.ejb.SessionBean;
import javax.ejb.SessionContext;

public class MyWebService implements SessionBean {

    private SessionContext ctx;

    public ReturnWeb_Login web_Login(
                        String user_name,
                        String user_password) throws RemoteException {

                Integer successErrorCode = Messages_Codes.FAILURE;
                String soap_session_id  = null;
                Connection con = null;

                try {
                       con = getConnection();
                       successErrorCode = CallCentreDAO.login(con,
                                 user_name, user_password, this);

                       if(Messages_Codes.SUCCESS == successErrorCode) {
                         SoapSession soapSession =
                         soapSession.setTimestamp( Calendar.getInstance() );
                         soap_session_id = serviceLocator.getSoapSession_Id

                       } else {
                         successErrorCode =
                } catch(Exception ex) {
                        successErrorCode = Messages_Codes.FAILURE;
                } finally {
                                try{con.close();}catch(SQLException ex){};

                return new ReturnWeb_Login (
Messages_Codes.get(successErrorCode), successErrorCode.intValue(),
soap_session_id, user_name);

So what this does is allow EJB transactions in a web service - notice
ctx.setRollbackOnly() ,  and a soap session managed by the EJB container via
a stateful session bean.

OK, so why can you _not_ do this with Axis2 ?

1) JBoss modified axis 1.x to support ejb transactions:

JBossWS4EE <> is
J2EE-1.4compliant and available starting from
jboss-4.0.0. It relies on a modified version of axis-1.1. This stack should
no longer be used.

2) JBoss now is pushing JBossWS, based seemingly largely - but not entirely
- on JAX-WS. Its spec support and completion status are here:

3) Most importantly: "Any stack not listed above is *not supported*."

So just to be clear: You can use Axis2 with EJB just fine as long as you do
not want to have the ServiceClass implement SessionBean - this is at least
true for JBoss. I think everyone agrees you can invoke an EJB anywhere
anytime in any container as any web layer class would.

Now it would be interesting to try to implement the scenerio above with
JBoss and Axis2 since the sources are open. However, (A) It'd be a labor of
love and I just don't see feel it (B) JBoss is GPL and axis2 is Apache
licenesed of course, and (C)  It'd be unsupported by JBoss and even if it
did work, the sanity of such a scenerio is rightfully questioned by sanjiva
and many others.


View raw message