geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r654550 - in /geronimo/server/branches/2.1: plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/ testsuite/webservices-testsuite/jaxws-tests/jaxws-ejb/src/main/java/org/apache/geronimo/test/ testsui...
Date Thu, 08 May 2008 15:27:28 GMT
Author: gawor
Date: Thu May  8 08:27:28 2008
New Revision: 654550

URL: http://svn.apache.org/viewvc?rev=654550&view=rev
Log:
Make deployment of EJB-based JAX-WS web service with WebServiceContext injection work (GERONIMO-4006)

Modified:
    geronimo/server/branches/2.1/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
    geronimo/server/branches/2.1/testsuite/webservices-testsuite/jaxws-tests/jaxws-ejb/src/main/java/org/apache/geronimo/test/JAXWSBean.java
    geronimo/server/branches/2.1/testsuite/webservices-testsuite/jaxws-tests/jaxws-ejb/src/main/java/org/apache/geronimo/test/JAXWSGreeter.java
    geronimo/server/branches/2.1/testsuite/webservices-testsuite/jaxws-tests/jaxws-ejb/src/test/java/org/apache/geronimo/testsuite/testset/JaxWSTest.java

Modified: geronimo/server/branches/2.1/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java?rev=654550&r1=654549&r2=654550&view=diff
==============================================================================
--- geronimo/server/branches/2.1/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
(original)
+++ geronimo/server/branches/2.1/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
Thu May  8 08:27:28 2008
@@ -38,6 +38,7 @@
 import javax.ejb.SessionContext;
 import javax.ejb.TimerService;
 import javax.xml.namespace.QName;
+import javax.xml.ws.WebServiceContext;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -400,7 +401,9 @@
                 } else if (ref.getType().equals(MessageDrivenContext.class.getName())) {
                     iterator.remove();
                 } else if (ref.getType().equals(TimerService.class.getName())) {
-                    iterator.remove();                
+                    iterator.remove();   
+                } else if (ref.getType().equals(WebServiceContext.class.getName())) {
+                    iterator.remove();
                 } else {
                     ref.setMappedName(null);
                 }

Modified: geronimo/server/branches/2.1/testsuite/webservices-testsuite/jaxws-tests/jaxws-ejb/src/main/java/org/apache/geronimo/test/JAXWSBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/testsuite/webservices-testsuite/jaxws-tests/jaxws-ejb/src/main/java/org/apache/geronimo/test/JAXWSBean.java?rev=654550&r1=654549&r2=654550&view=diff
==============================================================================
--- geronimo/server/branches/2.1/testsuite/webservices-testsuite/jaxws-tests/jaxws-ejb/src/main/java/org/apache/geronimo/test/JAXWSBean.java
(original)
+++ geronimo/server/branches/2.1/testsuite/webservices-testsuite/jaxws-tests/jaxws-ejb/src/main/java/org/apache/geronimo/test/JAXWSBean.java
Thu May  8 08:27:28 2008
@@ -18,6 +18,11 @@
  */
 package org.apache.geronimo.test;
 
+import java.util.Iterator;
+import java.util.Map;
+import java.util.logging.Logger;
+
+import javax.annotation.Resource;
 import javax.ejb.Remote;
 import javax.ejb.Stateless;
 import javax.jws.WebService;
@@ -27,6 +32,8 @@
 import javax.xml.soap.SOAPException;
 import javax.xml.soap.SOAPFactory;
 import javax.xml.soap.SOAPFault;
+import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.handler.MessageContext;
 import javax.xml.ws.soap.SOAPFaultException;
 
 @WebService
@@ -39,14 +46,37 @@
 )
 public class JAXWSBean implements JAXWSGreeter { 
 
+    private static final Logger LOG =
+        Logger.getLogger(JAXWSBean.class.getName());
+
+    @Resource
+    private WebServiceContext context;
+
     public String greetMe(String me) {
+        LOG.info("WebServiceContext: " + context);
+        LOG.info("Principal: " + context.getUserPrincipal());
+        LOG.info("Context: " + context.getMessageContext());
+
+        MessageContext ctx = context.getMessageContext();
+        Iterator iter = ctx.entrySet().iterator();
+        while(iter.hasNext()) {
+            Map.Entry entry = (Map.Entry)iter.next();
+            System.out.println("Key: "+entry.getKey());
+            System.out.println("Value: " +entry.getValue());
+        }
+
         System.out.println("i'm a ejb ws: " + me);
+
         if (!"foo bar".equals(me)) {
             throw new RuntimeException("Wrong parameter");
         }
         return "Hello " + me;
     }
     
+    public String greetMeEjb(String me) {
+        return "Hello EJB " + me;
+    }
+    
     public void greetMeFault(String me) {
         System.out.println("generate SOAP fault");
         SOAPFault fault = null;

Modified: geronimo/server/branches/2.1/testsuite/webservices-testsuite/jaxws-tests/jaxws-ejb/src/main/java/org/apache/geronimo/test/JAXWSGreeter.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/testsuite/webservices-testsuite/jaxws-tests/jaxws-ejb/src/main/java/org/apache/geronimo/test/JAXWSGreeter.java?rev=654550&r1=654549&r2=654550&view=diff
==============================================================================
--- geronimo/server/branches/2.1/testsuite/webservices-testsuite/jaxws-tests/jaxws-ejb/src/main/java/org/apache/geronimo/test/JAXWSGreeter.java
(original)
+++ geronimo/server/branches/2.1/testsuite/webservices-testsuite/jaxws-tests/jaxws-ejb/src/main/java/org/apache/geronimo/test/JAXWSGreeter.java
Thu May  8 08:27:28 2008
@@ -19,7 +19,7 @@
 package org.apache.geronimo.test;
 
 public interface JAXWSGreeter { 
-
-    public String greetMe(String me);
+    
+    public String greetMeEjb(String me);
 
 }

Modified: geronimo/server/branches/2.1/testsuite/webservices-testsuite/jaxws-tests/jaxws-ejb/src/test/java/org/apache/geronimo/testsuite/testset/JaxWSTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/testsuite/webservices-testsuite/jaxws-tests/jaxws-ejb/src/test/java/org/apache/geronimo/testsuite/testset/JaxWSTest.java?rev=654550&r1=654549&r2=654550&view=diff
==============================================================================
--- geronimo/server/branches/2.1/testsuite/webservices-testsuite/jaxws-tests/jaxws-ejb/src/test/java/org/apache/geronimo/testsuite/testset/JaxWSTest.java
(original)
+++ geronimo/server/branches/2.1/testsuite/webservices-testsuite/jaxws-tests/jaxws-ejb/src/test/java/org/apache/geronimo/testsuite/testset/JaxWSTest.java
Thu May  8 08:27:28 2008
@@ -245,11 +245,11 @@
         
         JAXWSGreeter greeter = (JAXWSGreeter)ctx.lookup("/JAXWSBeanRemote");
         
-        String response = greeter.greetMe("foo bar");
+        String response = greeter.greetMeEjb("foo bar");
         
         System.out.println(response);
         
-        assertEquals("Hello foo bar", response);
+        assertEquals("Hello EJB foo bar", response);
     }
 
 }



Mime
View raw message