Return-Path: Mailing-List: contact axis-user-help@xml.apache.org; run by ezmlm Delivered-To: mailing list axis-user@xml.apache.org Received: (qmail 47180 invoked from network); 14 Jun 2002 14:26:01 -0000 Received: from web.ardentsoftware.com (HELO asc-bh-01.ascentialsoftware.com) (4.21.160.3) by daedalus.apache.org with SMTP; 14 Jun 2002 14:26:01 -0000 Received: by asc-bh-01.ascentialsoftware.com with Internet Mail Service (5.5.2653.19) id ; Fri, 14 Jun 2002 10:29:16 -0400 Message-ID: From: thomas.cherel@ascentialsoftware.com To: axis-user@xml.apache.org Subject: RE: Exposing EJBs as web services... Date: Fri, 14 Jun 2002 10:29:07 -0400 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C213AF.D7A36750" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01C213AF.D7A36750 Content-Type: text/plain; charset="ISO-8859-1" I played with the EJB as web service quite a bit with Axis. Here is the result of my findings: 1) With Axis you can configure which methods are exposed when you deploy the web service. In the EJB case, what you expose to the web service client is the remote interface (Axis server act as the EJB client). You can decide to expose the methods inherited from EJBObject by the remote interface if you want to. 2) Axis session (when service is declared with a session scope in the wsdd) are maintained by caching the web service implementation object using the HTTPSession object. For the EJB, it means that the EJB client object (Axis server act as the EJBClient) is the object which is cached. But the current EJBProvider has no support for any kind of EJB error recovery. If the EJB session is timing out, your web service in the current web service session is broken. You have no way form the web service client to ask Axis to "refresh" the cached service implementation object. I also tried with stateful EJB. If a runtime exception in the stateful bean implementation is occurring, EJB spec states that stateful bean is discarded. But Axis EJB provider does not handle that at all (it does not try to detect runtime exception and then discarded the cached object). You can look at a the code of the current EJBProvider for Axis (xml-axis-beta2/java/src/org/apache/axis/providers/java/EJBProvider.java). It is pretty straightforward to understand. But for production application using EJBs as web service implementation with Axis, this provider needs to be improved. Thomas -----Original Message----- From: Mark_Palmer@wildfire.com [mailto:Mark_Palmer@wildfire.com] Sent: Friday, June 14, 2002 6:12 AM To: axis-user@xml.apache.org Subject: RE: Exposing EJBs as web services... Exposing an EJB as a web service sounds very interesting. Does anyone know how session state is maintained? If the EJB's methods are actually exposed to Axis clients, how is session timeout state handled? When a session is completed (say it's a stateful session bean), how does Axis know that the session and the bean need to be destroyed? -Mark -------------------------------------------------- There is no spoon. -------------------------------------------------- "Hurst, Cyrus" tings.com> cc: Subject: RE: Exposing EJBs as web services... 06/13/2002 06:02 PM Please respond to axis-user Hello, To solve the NoClassDefFoundErrors I had to copy the Remote and Home interfaces for my EJB and any classes that the Remote interface has dependencies on into the axis/WEB-INF/classes/ directory . Once I got thru that I kept getting unknown operation(on both client and server console) on the exposed method of the EJB . So I wrote and deployed a class as a web-service(using provider="java:RPC") that basically acts as a delegate to the EJB . I used the same client code to test it and it ran fine . I undeployed that web-service and re-deployed the other web-service using provider ="java:EJB" and I still get the unkown operation on the method of the EJB. My deployment descriptors are as follows: For RPC - For EJB - As you can see I'm using the same operation name for both styles . In the delegate class(TestCprEJBClient) I use the same parameters in the EJB wsdd to do jndi lookup, create Home interface, etc .... Am I missing something? Thanks, -Cyrus -----Original Message----- From: thomas.cherel@ascentialsoftware.com [mailto:thomas.cherel@ascentialsoftware.com] Sent: Wednesday, June 12, 2002 6:01 PM To: axis-user@xml.apache.org Subject: RE: Exposing EJBs as web services... Exception messages can just be serialized and passed form one client to another. May be trying to write an independent EJB client and making it work first can be a good idea. It will remove the Axis piece. This EJB client should be able to work only with the Home and remote interface in the classpath. If you are still getting some exceptions on the weblogic console, it means that your bean is not correctly deployed. -----Original Message----- From: Hurst, Cyrus [mailto:Cyrus_Hurst@tvratings.com] Sent: Wednesday, June 12, 2002 5:41 PM To: 'axis-user@xml.apache.org' Subject: RE: Exposing EJBs as web services... Both ..On the client console I get : weblogic.rmi.extensions.RemoteRuntimeException - with nested exception: [java.lang.NoClassDefFoundError: com/nielsenmedia/lrs/cpr/common/CPREnterpriseException] at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:13 4) at org.apache.axis.encoding.DeserializationContextImpl.endElement(Deserializati onCo at org.apache.xerces.parsers.SAXParser.endElement(SAXParser.java:1403) at org.apache.xerces.validators.common.XMLValidator.callEndElement(XMLValidator .jav at org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XM LDoc at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner. java at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1081) at javax.xml.parsers.SAXParser.parse(SAXParser.java:345) at org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationCon text at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:455) at org.apache.axis.Message.getSOAPEnvelope(Message.java:321) at org.apache.axis.client.Call.invoke(Call.java:1954) at org.apache.axis.client.Call.invoke(Call.java:1707) at org.apache.axis.client.Call.invoke(Call.java:1635) at org.apache.axis.client.Call.invoke(Call.java:1184) at TestCprRpcClient.main(TestCprRpcClient.java:36) [INFO] Call - -Mapping Exception to AxisFault weblogic.rmi.extensions.RemoteRuntimeException - with nested exception: [java.lang.NoClassDefFoundError: com/nielsenmedia/lrs/cpr/common/CPREnterpriseException] On the server(running Weblogic 6.1) console I get : weblogic.rmi.extensions.RemoteRuntimeException - with nested exception: [java.lang.NoClassDefFoundError: com/nielsenmedia/lrs/cpr/common/CPREnterpriseException] at weblogic.rmi.internal.ProxyStub.invoke(ProxyStub.java:60) at $Proxy56.lookup(Unknown Source) at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:323) at javax.naming.InitialContext.lookup(InitialContext.java:350) at org.apache.axis.providers.java.EJBProvider.getEJBHome(EJBProvider.java:300) at org.apache.axis.providers.java.EJBProvider.getNewServiceObject(EJBProvider.j ava:109) at org.apache.axis.providers.java.JavaProvider.getServiceObject(JavaProvider.ja va:126) at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:234) at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java: 71) at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:154) at org.apache.axis.SimpleChain.invoke(SimpleChain.java:121) at org.apache.axis.server.AxisServer.invoke(AxisServer.java:288) at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:576) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java :265) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java :200) at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo ntext.java:2456) at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java :2039) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120) Thanks again , -Cyrus -----Original Message----- From: thomas.cherel@ascentialsoftware.com [mailto:thomas.cherel@ascentialsoftware.com] Sent: Wednesday, June 12, 2002 5:35 PM To: axis-user@xml.apache.org Subject: RE: Exposing EJBs as web services... ------_=_NextPart_001_01C213AF.D7A36750--