Return-Path: Delivered-To: apmail-ws-axis-user-archive@www.apache.org Received: (qmail 69381 invoked from network); 17 Jun 2006 12:13:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 17 Jun 2006 12:13:22 -0000 Received: (qmail 82253 invoked by uid 500); 17 Jun 2006 12:13:14 -0000 Delivered-To: apmail-ws-axis-user-archive@ws.apache.org Received: (qmail 81987 invoked by uid 500); 17 Jun 2006 12:13:11 -0000 Mailing-List: contact axis-user-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-user@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-user@ws.apache.org Received: (qmail 81971 invoked by uid 99); 17 Jun 2006 12:13:11 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 17 Jun 2006 05:13:11 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of robertlazarski@gmail.com designates 64.233.162.195 as permitted sender) Received: from [64.233.162.195] (HELO nz-out-0102.google.com) (64.233.162.195) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 17 Jun 2006 05:13:10 -0700 Received: by nz-out-0102.google.com with SMTP id l1so656319nzf for ; Sat, 17 Jun 2006 05:12:49 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=PaElkD/0Syltdtt9hQB4AcyznhgVYzjTjBsOF0f15q5yw2DovkSMspMqm8u1GjakmAz1OmZ1EhZt17yP23Kf4X9yGxgJTz+jhItQClyVNEDcQAwIyXKZDEUy0T2wmRv24fPg2fRCLjtF2cVWXYDXByypWnWVu1qORHuyGYiHLtE= Received: by 10.36.91.5 with SMTP id o5mr3128611nzb; Sat, 17 Jun 2006 05:12:49 -0700 (PDT) Received: by 10.37.18.8 with HTTP; Sat, 17 Jun 2006 05:12:49 -0700 (PDT) Message-ID: Date: Sat, 17 Jun 2006 09:12:49 -0300 From: "robert lazarski" To: axis-user@ws.apache.org Subject: Re: [AXIS2] J2EE Support In-Reply-To: <44931387.2080103@sosnoski.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_7587_25632378.1150546369094" References: <4492E2BA.4030508@opensource.lk> <44931387.2080103@sosnoski.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_7587_25632378.1150546369094 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 6/16/06, Dennis Sosnoski wrote: > > robert lazarski wrote: > > > > 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: MyWebService org.MyWebService Stateless ejb/SoapSession Session org.SoapSessionHome org.SoapSession ... 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, call_centre_id, user_name, user_password, this); if(Messages_Codes.SUCCESS == successErrorCode) { SoapSession soapSession = serviceLocator.getSoapSessionHome().create(); soapSession.setTimestamp( Calendar.getInstance() ); soap_session_id = serviceLocator.getSoapSession_Id (soapSession); } else { successErrorCode = Messages_Codes.AuthorizationFailed; } } catch(Exception ex) { ctx.setRollbackOnly(); successErrorCode = Messages_Codes.FAILURE; } finally { if(con!=null) 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: http://wiki.jboss.org/wiki/Wiki.jsp?page=WebServiceStacks 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: http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossWSSpecStatus 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. Cheers, Robert http://www.braziloutsource.com/ ------=_Part_7587_25632378.1150546369094 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline

On 6/16/06, Dennis Sosnoski <dms@sosnoski.com> 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:

<enterprise-beans>
  <session>
    <ejb-name>MyWebService</ejb-name>
    <ejb-class>org.MyWebService</ejb-class>
    <session-type>Stateless</session-type>
    <ejb-ref>
        <!-- SoapSession is a stateful session bean -->
        <ejb-ref-name>ejb/SoapSession</ejb-ref-name>
        <ejb-ref-type>Session</ejb-ref-type>
        <home>org.SoapSessionHome</home>
        <remote>org.SoapSession</remote>
    </ejb-ref>
    ...
   <session>
 </enterprise-beans>
 
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, call_centre_id,
                                 user_name, user_password, this);

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

                       } else {
                         successErrorCode = Messages_Codes.AuthorizationFailed;
                       }
                } catch(Exception ex) {
                        ctx.setRollbackOnly();
                        successErrorCode = Messages_Codes.FAILURE;
                } finally {
                        if(con!=null)
                                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:

http://wiki.jboss.org/wiki/Wiki.jsp?page=WebServiceStacks

JBossWS4EE is J2EE-1.4 compliant 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:

http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossWSSpecStatus

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.

Cheers,
Robert
http://www.braziloutsource.com/
------=_Part_7587_25632378.1150546369094--