[jboss-cvs] JBossAS SVN: r107045 - branches/JBPAPP_5_1/webservices/src/etc/examples/logicalhandler/java/org/jboss/test/ws/jaxws/samples/logicalhandler.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Jul 23 03:31:19 EDT 2010


Author: jim.ma
Date: 2010-07-23 03:31:18 -0400 (Fri, 23 Jul 2010)
New Revision: 107045

Added:
   branches/JBPAPP_5_1/webservices/src/etc/examples/logicalhandler/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointJAXBService.java
   branches/JBPAPP_5_1/webservices/src/etc/examples/logicalhandler/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointSourceService.java
Modified:
   branches/JBPAPP_5_1/webservices/src/etc/examples/logicalhandler/java/org/jboss/test/ws/jaxws/samples/logicalhandler/LogicalHandlerJAXBTestCase.java
   branches/JBPAPP_5_1/webservices/src/etc/examples/logicalhandler/java/org/jboss/test/ws/jaxws/samples/logicalhandler/LogicalHandlerSourceTestCase.java
   branches/JBPAPP_5_1/webservices/src/etc/examples/logicalhandler/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointJAXB.java
   branches/JBPAPP_5_1/webservices/src/etc/examples/logicalhandler/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointSourceDoc.java
   branches/JBPAPP_5_1/webservices/src/etc/examples/logicalhandler/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointSourceRpc.java
Log:
[JBPAPP-4565]:Update logicalhandler example

Modified: branches/JBPAPP_5_1/webservices/src/etc/examples/logicalhandler/java/org/jboss/test/ws/jaxws/samples/logicalhandler/LogicalHandlerJAXBTestCase.java
===================================================================
--- branches/JBPAPP_5_1/webservices/src/etc/examples/logicalhandler/java/org/jboss/test/ws/jaxws/samples/logicalhandler/LogicalHandlerJAXBTestCase.java	2010-07-23 07:27:21 UTC (rev 107044)
+++ branches/JBPAPP_5_1/webservices/src/etc/examples/logicalhandler/java/org/jboss/test/ws/jaxws/samples/logicalhandler/LogicalHandlerJAXBTestCase.java	2010-07-23 07:31:18 UTC (rev 107045)
@@ -35,6 +35,7 @@
 /**
  * Test JAXWS logical handlers
  *
+ * @author <a href="mailto:ropalka at redhat.com">Richard Opalka</a>
  * @author Thomas.Diesler at jboss.org
  * @since 12-Aug-2006
  */
@@ -49,7 +50,7 @@
    {
       String endpointAddress = "http://" + getServerHost() + ":8080/jaxws-samples-logicalhandler-jaxb";
       QName serviceName = new QName("http://org.jboss.ws/jaxws/samples/logicalhandler", "SOAPEndpointService");
-      Service service = Service.create(new URL(endpointAddress + "?wsdl"), serviceName);
+      Service service = new SOAPEndpointJAXBService(new URL(endpointAddress + "?wsdl"), serviceName);
       SOAPEndpointJAXB port = (SOAPEndpointJAXB)service.getPort(SOAPEndpointJAXB.class);
 
       BindingProvider bindingProvider = (BindingProvider)port;
@@ -58,23 +59,9 @@
       String retStr = port.echo("hello");
 
       StringBuffer expStr = new StringBuffer("hello");
-      if (isIntegrationNative())
-      {
-         expStr.append(":Outbound:LogicalJAXBHandler");
-         expStr.append(":Outbound:ProtocolHandler");
-         expStr.append(":Outbound:PortHandler");
-      }
-      else
-      {
-         if (isIntegrationMetro())
-         {
-            System.out.println("FIXME: [JBWS-1672] Metro does not respect @HandlerChain on client SEI");
-         }
-         else
-         {
-            System.out.println("FIXME: [CXF-1253] CXF does not respect @HandlerChain on client SEI");
-         }
-      }
+      expStr.append(":Outbound:LogicalJAXBHandler");
+      expStr.append(":Outbound:ProtocolHandler");
+      expStr.append(":Outbound:PortHandler");
       expStr.append(":Inbound:PortHandler");
       expStr.append(":Inbound:ProtocolHandler");
       expStr.append(":Inbound:LogicalJAXBHandler");
@@ -82,23 +69,9 @@
       expStr.append(":Outbound:LogicalJAXBHandler");
       expStr.append(":Outbound:ProtocolHandler");
       expStr.append(":Outbound:PortHandler");
-      if (isIntegrationNative())
-      {
-         expStr.append(":Inbound:PortHandler");
-         expStr.append(":Inbound:ProtocolHandler");
-         expStr.append(":Inbound:LogicalJAXBHandler");
-      }
-      else
-      {
-         if (isIntegrationMetro())
-         {
-            System.out.println("FIXME: [JBWS-1672] Metro does not respect @HandlerChain on client SEI");
-         }
-         else
-         {
-            System.out.println("FIXME: [CXF-1253] CXF does not respect @HandlerChain on client SEI");
-         }
-      }
+      expStr.append(":Inbound:PortHandler");
+      expStr.append(":Inbound:ProtocolHandler");
+      expStr.append(":Inbound:LogicalJAXBHandler");
       assertEquals(expStr.toString(), retStr);
    }
 }

Modified: branches/JBPAPP_5_1/webservices/src/etc/examples/logicalhandler/java/org/jboss/test/ws/jaxws/samples/logicalhandler/LogicalHandlerSourceTestCase.java
===================================================================
--- branches/JBPAPP_5_1/webservices/src/etc/examples/logicalhandler/java/org/jboss/test/ws/jaxws/samples/logicalhandler/LogicalHandlerSourceTestCase.java	2010-07-23 07:27:21 UTC (rev 107044)
+++ branches/JBPAPP_5_1/webservices/src/etc/examples/logicalhandler/java/org/jboss/test/ws/jaxws/samples/logicalhandler/LogicalHandlerSourceTestCase.java	2010-07-23 07:31:18 UTC (rev 107045)
@@ -46,86 +46,32 @@
 
    public void testSourceDoc() throws Exception
    {
-      String endpointAddress = "http://" + getServerHost() + ":8080/jaxws-samples-logicalhandler-source/doc";
+      URL endpointAddress = new URL("http://" + getServerHost() + ":8080/jaxws-samples-logicalhandler-source/doc?wsdl");
       QName serviceName = new QName("http://org.jboss.ws/jaxws/samples/logicalhandler", "SOAPEndpointDocService");
-      Service service = Service.create(new URL(endpointAddress + "?wsdl"), serviceName);
+      Service service = new SOAPEndpointSourceService(endpointAddress, serviceName);
       SOAPEndpointSourceDoc port = (SOAPEndpointSourceDoc)service.getPort(SOAPEndpointSourceDoc.class);
       
       String retStr = port.echo("hello");
-      
-      StringBuffer expStr = new StringBuffer("hello");
-      if (isIntegrationNative())
-      {
-         expStr.append(":Outbound:LogicalSourceHandler");
-         expStr.append(":Outbound:ProtocolHandler");
-         expStr.append(":Outbound:PortHandler");
-      }
-      else
-      {
-         if (isIntegrationMetro())
-         {
-            System.out.println("FIXME: [JBWS-1672] Metro does not respect @HandlerChain on client SEI");
-         }
-         else
-         {
-            System.out.println("FIXME: [CXF-1253] CXF does not respect @HandlerChain on client SEI");
-         }
-      }
-      expStr.append(":Inbound:PortHandler");
-      expStr.append(":Inbound:ProtocolHandler");
-      expStr.append(":Inbound:LogicalSourceHandler");
-      expStr.append(":endpoint");
-      expStr.append(":Outbound:LogicalSourceHandler");
-      expStr.append(":Outbound:ProtocolHandler");
-      expStr.append(":Outbound:PortHandler");
-      if (isIntegrationNative())
-      {
-         expStr.append(":Inbound:PortHandler");
-         expStr.append(":Inbound:ProtocolHandler");
-         expStr.append(":Inbound:LogicalSourceHandler");
-      }
-      else
-      {
-         if (isIntegrationMetro())
-         {
-            System.out.println("FIXME: [JBWS-1672] Metro does not respect @HandlerChain on client SEI");
-         }
-         else
-         {
-            System.out.println("FIXME: [CXF-1253] CXF does not respect @HandlerChain on client SEI");
-         }
-      }
-      assertEquals(expStr.toString(), retStr);
+      assertResponse(retStr);
    }
 
-
    public void testSourceRpc() throws Exception
    {
-      String endpointAddress = "http://" + getServerHost() + ":8080/jaxws-samples-logicalhandler-source/rpc";
+      URL endpointAddress = new URL("http://" + getServerHost() + ":8080/jaxws-samples-logicalhandler-source/rpc?wsdl");
       QName serviceName = new QName("http://org.jboss.ws/jaxws/samples/logicalhandler", "SOAPEndpointRpcService");
-      Service service = Service.create(new URL(endpointAddress + "?wsdl"), serviceName);
+      Service service = new SOAPEndpointSourceService(endpointAddress, serviceName);
       SOAPEndpointSourceRpc port = (SOAPEndpointSourceRpc)service.getPort(SOAPEndpointSourceRpc.class);
       
       String retStr = port.echo("hello");
-      
+      assertResponse(retStr);
+   }
+   
+   private void assertResponse(String retStr)
+   {
       StringBuffer expStr = new StringBuffer("hello");
-      if (isIntegrationNative())
-      {
-         expStr.append(":Outbound:LogicalSourceHandler");
-         expStr.append(":Outbound:ProtocolHandler");
-         expStr.append(":Outbound:PortHandler");
-      }
-      else
-      {
-         if (isIntegrationMetro())
-         {
-            System.out.println("FIXME: [JBWS-1672] Metro does not respect @HandlerChain on client SEI");
-         }
-         else
-         {
-            System.out.println("FIXME: [CXF-1253] CXF does not respect @HandlerChain on client SEI");
-         }
-      }
+      expStr.append(":Outbound:LogicalSourceHandler");
+      expStr.append(":Outbound:ProtocolHandler");
+      expStr.append(":Outbound:PortHandler");
       expStr.append(":Inbound:PortHandler");
       expStr.append(":Inbound:ProtocolHandler");
       expStr.append(":Inbound:LogicalSourceHandler");
@@ -133,23 +79,9 @@
       expStr.append(":Outbound:LogicalSourceHandler");
       expStr.append(":Outbound:ProtocolHandler");
       expStr.append(":Outbound:PortHandler");
-      if (isIntegrationNative()) 
-      {
-         expStr.append(":Inbound:PortHandler");
-         expStr.append(":Inbound:ProtocolHandler");
-         expStr.append(":Inbound:LogicalSourceHandler");
-      }
-      else
-      {
-         if (isIntegrationMetro())
-         {
-            System.out.println("FIXME: [JBWS-1672] Metro does not respect @HandlerChain on client SEI");
-         }
-         else
-         {
-            System.out.println("FIXME: [CXF-1253] CXF does not respect @HandlerChain on client SEI");
-         }
-      }
+      expStr.append(":Inbound:PortHandler");
+      expStr.append(":Inbound:ProtocolHandler");
+      expStr.append(":Inbound:LogicalSourceHandler");
       assertEquals(expStr.toString(), retStr);
    }
 }

Modified: branches/JBPAPP_5_1/webservices/src/etc/examples/logicalhandler/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointJAXB.java
===================================================================
--- branches/JBPAPP_5_1/webservices/src/etc/examples/logicalhandler/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointJAXB.java	2010-07-23 07:27:21 UTC (rev 107044)
+++ branches/JBPAPP_5_1/webservices/src/etc/examples/logicalhandler/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointJAXB.java	2010-07-23 07:31:18 UTC (rev 107045)
@@ -21,7 +21,6 @@
  */
 package org.jboss.test.ws.jaxws.samples.logicalhandler;
 
-import javax.jws.HandlerChain;
 import javax.jws.WebMethod;
 import javax.jws.WebParam;
 import javax.jws.WebResult;
@@ -30,14 +29,11 @@
 import javax.xml.ws.ResponseWrapper;
 
 @WebService(name = "SOAPEndpoint", targetNamespace = "http://org.jboss.ws/jaxws/samples/logicalhandler")
- at HandlerChain(file = "jaxws-client-jaxb-handlers.xml")
 public interface SOAPEndpointJAXB
 {
-
    @WebMethod
    @WebResult(targetNamespace = "http://org.jboss.ws/jaxws/samples/logicalhandler", name = "result")
    @RequestWrapper(className = "org.jboss.test.ws.jaxws.samples.logicalhandler.Echo")
    @ResponseWrapper(className = "org.jboss.test.ws.jaxws.samples.logicalhandler.EchoResponse")
    public String echo(@WebParam(targetNamespace = "http://org.jboss.ws/jaxws/samples/logicalhandler", name="String_1") String string1);
-
 }

Added: branches/JBPAPP_5_1/webservices/src/etc/examples/logicalhandler/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointJAXBService.java
===================================================================
--- branches/JBPAPP_5_1/webservices/src/etc/examples/logicalhandler/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointJAXBService.java	                        (rev 0)
+++ branches/JBPAPP_5_1/webservices/src/etc/examples/logicalhandler/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointJAXBService.java	2010-07-23 07:31:18 UTC (rev 107045)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.logicalhandler;
+
+import java.net.URL;
+
+import javax.jws.HandlerChain;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+/**
+ * @author <a href="mailto:ropalka at redhat.com">Richard Opalka</a>
+ */
+ at HandlerChain(file = "jaxws-client-jaxb-handlers.xml")
+public class SOAPEndpointJAXBService extends Service
+{
+   public SOAPEndpointJAXBService(URL wsdlLocation, QName serviceName)
+   {
+      super(wsdlLocation, serviceName);
+   }
+}

Modified: branches/JBPAPP_5_1/webservices/src/etc/examples/logicalhandler/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointSourceDoc.java
===================================================================
--- branches/JBPAPP_5_1/webservices/src/etc/examples/logicalhandler/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointSourceDoc.java	2010-07-23 07:27:21 UTC (rev 107044)
+++ branches/JBPAPP_5_1/webservices/src/etc/examples/logicalhandler/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointSourceDoc.java	2010-07-23 07:31:18 UTC (rev 107045)
@@ -21,7 +21,6 @@
  */
 package org.jboss.test.ws.jaxws.samples.logicalhandler;
 
-import javax.jws.HandlerChain;
 import javax.jws.WebMethod;
 import javax.jws.WebParam;
 import javax.jws.WebResult;
@@ -30,7 +29,6 @@
 import javax.xml.ws.ResponseWrapper;
 
 @WebService(name = "SOAPEndpointDoc", targetNamespace = "http://org.jboss.ws/jaxws/samples/logicalhandler")
- at HandlerChain(file = "jaxws-client-source-handlers.xml")
 public interface SOAPEndpointSourceDoc
 {
 

Modified: branches/JBPAPP_5_1/webservices/src/etc/examples/logicalhandler/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointSourceRpc.java
===================================================================
--- branches/JBPAPP_5_1/webservices/src/etc/examples/logicalhandler/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointSourceRpc.java	2010-07-23 07:27:21 UTC (rev 107044)
+++ branches/JBPAPP_5_1/webservices/src/etc/examples/logicalhandler/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointSourceRpc.java	2010-07-23 07:31:18 UTC (rev 107045)
@@ -21,14 +21,12 @@
  */
 package org.jboss.test.ws.jaxws.samples.logicalhandler;
 
-import javax.jws.HandlerChain;
 import javax.jws.WebMethod;
 import javax.jws.WebService;
 import javax.jws.soap.SOAPBinding;
 import javax.jws.soap.SOAPBinding.Style;
 
 @WebService(name = "SOAPEndpointRpc", targetNamespace = "http://org.jboss.ws/jaxws/samples/logicalhandler")
- at HandlerChain(file = "jaxws-client-source-handlers.xml")
 @SOAPBinding(style = Style.RPC)
 public interface SOAPEndpointSourceRpc
 {

Added: branches/JBPAPP_5_1/webservices/src/etc/examples/logicalhandler/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointSourceService.java
===================================================================
--- branches/JBPAPP_5_1/webservices/src/etc/examples/logicalhandler/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointSourceService.java	                        (rev 0)
+++ branches/JBPAPP_5_1/webservices/src/etc/examples/logicalhandler/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointSourceService.java	2010-07-23 07:31:18 UTC (rev 107045)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.logicalhandler;
+
+import java.net.URL;
+
+import javax.jws.HandlerChain;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+/**
+ * @author <a href="mailto:ropalka at redhat.com">Richard Opalka</a>
+ */
+ at HandlerChain(file = "jaxws-client-source-handlers.xml")
+public class SOAPEndpointSourceService extends Service
+{
+   public SOAPEndpointSourceService(URL wsdlLocation, QName serviceName)
+   {
+      super(wsdlLocation, serviceName);
+   }
+}



More information about the jboss-cvs-commits mailing list