[jbossws-commits] JBossWS SVN: r8123 - in stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089: src/main/java/org/jboss/ws/core/jaxws/handler and 5 other directories.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Wed Aug 20 05:40:10 EDT 2008


Author: darran.lofthouse at jboss.com
Date: 2008-08-20 05:40:09 -0400 (Wed, 20 Aug 2008)
New Revision: 8123

Added:
   stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/java/org/jboss/test/ws/jaxws/jbws2285/
   stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/java/org/jboss/test/ws/jaxws/jbws2285/Endpoint.java
   stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/java/org/jboss/test/ws/jaxws/jbws2285/EndpointImpl.java
   stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/java/org/jboss/test/ws/jaxws/jbws2285/JBWS2285TestCase.java
   stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/java/org/jboss/test/ws/jaxws/jbws2285/LogicalHandler.java
   stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/resources/jaxws/jbws2285/
   stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/resources/jaxws/jbws2285/WEB-INF/
   stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/resources/jaxws/jbws2285/WEB-INF/jboss-web.xml
   stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/resources/jaxws/jbws2285/WEB-INF/server-handlers.xml
   stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/resources/jaxws/jbws2285/WEB-INF/web.xml
   stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/resources/jaxws/jbws2285/request-message.xml
Removed:
   stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/java/org/jboss/test/ws/jaxws/jbws2285/Endpoint.java
   stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/java/org/jboss/test/ws/jaxws/jbws2285/EndpointImpl.java
   stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/java/org/jboss/test/ws/jaxws/jbws2285/JBWS2285TestCase.java
   stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/java/org/jboss/test/ws/jaxws/jbws2285/LogicalHandler.java
   stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/resources/jaxws/jbws2285/WEB-INF/
   stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/resources/jaxws/jbws2285/WEB-INF/jboss-web.xml
   stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/resources/jaxws/jbws2285/WEB-INF/server-handlers.xml
   stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/resources/jaxws/jbws2285/WEB-INF/web.xml
   stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/resources/jaxws/jbws2285/request-message.xml
Modified:
   stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/ant-import-tests/build-jars-jaxws.xml
   stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/main/java/org/jboss/ws/core/jaxws/handler/LogicalMessageImpl.java
Log:
[JBPAPP-1089] ClassCastException: org.jboss.ws.core.soap.TextImpl in LogicalMessageImpl.getPayload.

Modified: stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/ant-import-tests/build-jars-jaxws.xml
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/ant-import-tests/build-jars-jaxws.xml	2008-08-19 18:16:36 UTC (rev 8122)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/ant-import-tests/build-jars-jaxws.xml	2008-08-20 09:40:09 UTC (rev 8123)
@@ -402,6 +402,18 @@
         <exclude name="org/jboss/test/ws/jaxws/jbws2000/*TestCase.class"/>
       </fileset>
     </jar>
+    
+    <!-- jaxws-jbws2285 -->
+    <war warfile="${tests.output.dir}/libs/jaxws-jbws2285.war" webxml="${tests.output.dir}/resources/jaxws/jbws2285/WEB-INF/web.xml">
+      <classes dir="${tests.output.dir}/classes">
+        <include name="org/jboss/test/ws/jaxws/jbws2285/*.class"/>
+        <exclude name="org/jboss/test/ws/jaxws/jbws2285/JBWS2285TestCase.class"/>
+      </classes>
+      <webinf dir="${tests.output.dir}/resources/jaxws/jbws2285/WEB-INF">
+        <include name="jboss-web.xml"/>
+        <include name="server-handlers.xml"/>
+      </webinf>
+    </war>       
 
     <!-- jaxws namespace -->
     <war warfile="${tests.output.dir}/libs/jaxws-namespace.war" webxml="${tests.output.dir}/resources/jaxws/namespace/WEB-INF/web.xml">

Modified: stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/main/java/org/jboss/ws/core/jaxws/handler/LogicalMessageImpl.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/main/java/org/jboss/ws/core/jaxws/handler/LogicalMessageImpl.java	2008-08-19 18:16:36 UTC (rev 8122)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/main/java/org/jboss/ws/core/jaxws/handler/LogicalMessageImpl.java	2008-08-20 09:40:09 UTC (rev 8123)
@@ -49,6 +49,8 @@
 import org.jboss.wsf.common.DOMUtils;
 import org.jboss.wsf.spi.util.ServiceLoader;
 import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
 
 /**
  * The LogicalMessageContext interface extends MessageContext to provide access to a the 
@@ -78,7 +80,7 @@
       {
          SOAPMessage soapMessage = (SOAPMessage)message;
          SOAPBodyImpl soapBody = getSOAPBody(soapMessage);
-         SOAPElement bodyElement = (SOAPElement)soapBody.getFirstChild();
+         SOAPElement bodyElement = getBodyElement(soapBody);
 
          if (style == Style.RPC)
          {
@@ -104,7 +106,7 @@
       {
          SOAPMessage soapMessage = (SOAPMessage)message;
          SOAPBodyImpl soapBody = getSOAPBody(soapMessage);
-         SOAPElement bodyElement = (SOAPElement)soapBody.getFirstChild();
+         SOAPElement bodyElement = getBodyElement(soapBody);
          try
          {
             if (style == Style.RPC)
@@ -138,9 +140,9 @@
          HTTPMessageImpl httpMessage = (HTTPMessageImpl)message;
          httpMessage.setXmlFragment(new XMLFragment(source));
       }
-      
+
       MessageContextAssociation.peekMessageContext().setModified(true);
-      
+
    }
 
    public Object getPayload(JAXBContext jaxbContext)
@@ -151,7 +153,7 @@
          SOAPMessage soapMessage = (SOAPMessage)message;
          SOAPBodyImpl soapBody = getSOAPBody(soapMessage);
 
-         SOAPContentElement bodyElement = (SOAPContentElement)soapBody.getFirstChild();
+         SOAPContentElement bodyElement = (SOAPContentElement)getBodyElement(soapBody);
          if (bodyElement != null)
          {
             payload = bodyElement.getObjectValue();
@@ -171,7 +173,7 @@
          SOAPMessage soapMessage = (SOAPMessage)message;
          SOAPBodyImpl soapBody = getSOAPBody(soapMessage);
 
-         SOAPContentElement bodyElement = (SOAPContentElement)soapBody.getFirstChild();
+         SOAPContentElement bodyElement = (SOAPContentElement)getBodyElement(soapBody);
          if (bodyElement != null)
          {
             bodyElement.setObjectValue(payload);
@@ -184,6 +186,23 @@
       }
    }
 
+   private SOAPElement getBodyElement(final SOAPBodyImpl soapBody)
+   {
+      SOAPElement bodyElement = null;
+
+      NodeList nodes = soapBody.getChildNodes();
+      for (int i = 0; i < nodes.getLength() && bodyElement == null; i++)
+      {
+         Node current = nodes.item(i);
+         if (current instanceof SOAPElement)
+         {
+            bodyElement = (SOAPElement)current;
+         }
+      }
+
+      return bodyElement;
+   }
+
    private SOAPBodyImpl getSOAPBody(SOAPMessage soapMessage)
    {
       SOAPBodyImpl soapBody = null;

Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/java/org/jboss/test/ws/jaxws/jbws2285 (from rev 8120, stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2285)

Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/java/org/jboss/test/ws/jaxws/jbws2285/Endpoint.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2285/Endpoint.java	2008-08-19 17:50:57 UTC (rev 8120)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/java/org/jboss/test/ws/jaxws/jbws2285/Endpoint.java	2008-08-20 09:40:09 UTC (rev 8123)
@@ -1,38 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.jbws2285;
-
-import javax.jws.WebService;
-
-/**
- * Test Endpoint.
- * 
- * @author darran.lofthouse at jboss.com
- * @since 19th August 2008
- */
- at WebService(name = "Endpoint", targetNamespace = "http://ws.jboss.org/jbws2285")
-public interface Endpoint
-{
-   
-   public String echo(final String message);
-
-}

Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/java/org/jboss/test/ws/jaxws/jbws2285/Endpoint.java (from rev 8120, stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2285/Endpoint.java)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/java/org/jboss/test/ws/jaxws/jbws2285/Endpoint.java	                        (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/java/org/jboss/test/ws/jaxws/jbws2285/Endpoint.java	2008-08-20 09:40:09 UTC (rev 8123)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.jbws2285;
+
+import javax.jws.WebService;
+
+/**
+ * Test Endpoint.
+ * 
+ * @author darran.lofthouse at jboss.com
+ * @since 19th August 2008
+ */
+ at WebService(name = "Endpoint", targetNamespace = "http://ws.jboss.org/jbws2285")
+public interface Endpoint
+{
+   
+   public String echo(final String message);
+
+}

Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/java/org/jboss/test/ws/jaxws/jbws2285/EndpointImpl.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2285/EndpointImpl.java	2008-08-19 17:50:57 UTC (rev 8120)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/java/org/jboss/test/ws/jaxws/jbws2285/EndpointImpl.java	2008-08-20 09:40:09 UTC (rev 8123)
@@ -1,43 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.jbws2285;
-
-import javax.jws.HandlerChain;
-import javax.jws.WebService;
-
-/**
- * Test Endpoint implementation.
- * 
- * @author darran.lofthouse at jboss.com
- * @since 19th August 2008
- */
- at WebService(name = "Endpoint", targetNamespace = "http://ws.jboss.org/jbws2285", endpointInterface = "org.jboss.test.ws.jaxws.jbws2285.Endpoint")
- at HandlerChain(file = "WEB-INF/server-handlers.xml")
-public class EndpointImpl implements Endpoint
-{
-
-   public String echo(final String message)
-   {
-      return message;
-   }
-
-}

Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/java/org/jboss/test/ws/jaxws/jbws2285/EndpointImpl.java (from rev 8120, stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2285/EndpointImpl.java)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/java/org/jboss/test/ws/jaxws/jbws2285/EndpointImpl.java	                        (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/java/org/jboss/test/ws/jaxws/jbws2285/EndpointImpl.java	2008-08-20 09:40:09 UTC (rev 8123)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.jbws2285;
+
+import javax.jws.HandlerChain;
+import javax.jws.WebService;
+
+/**
+ * Test Endpoint implementation.
+ * 
+ * @author darran.lofthouse at jboss.com
+ * @since 19th August 2008
+ */
+ at WebService(name = "Endpoint", targetNamespace = "http://ws.jboss.org/jbws2285", endpointInterface = "org.jboss.test.ws.jaxws.jbws2285.Endpoint")
+ at HandlerChain(file = "WEB-INF/server-handlers.xml")
+public class EndpointImpl implements Endpoint
+{
+
+   public String echo(final String message)
+   {
+      return message;
+   }
+
+}

Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/java/org/jboss/test/ws/jaxws/jbws2285/JBWS2285TestCase.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2285/JBWS2285TestCase.java	2008-08-19 17:50:57 UTC (rev 8120)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/java/org/jboss/test/ws/jaxws/jbws2285/JBWS2285TestCase.java	2008-08-20 09:40:09 UTC (rev 8123)
@@ -1,124 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.jbws2285;
-
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.IOException;
-import java.net.URL;
-import java.util.Iterator;
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.MessageFactory;
-import javax.xml.soap.SOAPBody;
-import javax.xml.soap.SOAPConnection;
-import javax.xml.soap.SOAPConnectionFactory;
-import javax.xml.soap.SOAPEnvelope;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.ws.Service;
-
-import junit.framework.Test;
-
-import org.jboss.ws.core.soap.NodeImpl;
-import org.jboss.wsf.test.JBossWSTest;
-import org.jboss.wsf.test.JBossWSTestSetup;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * [JBWS-2285] ClassCastException: org.jboss.ws.core.soap.TextImpl 
- * in LogicalMessageImpl.getPayload.
- * 
- * @author darran.lofthouse at jboss.com
- * @since 19th August 2008
- * @see https://jira.jboss.org/jira/browse/JBWS-2285
- */
-public class JBWS2285TestCase extends JBossWSTest
-{
-
-   public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() + ":8080/jaxws-jbws2285/";
-
-   private static Endpoint port;
-
-   public static Test suite() throws Exception
-   {
-      return new JBossWSTestSetup(JBWS2285TestCase.class, "jaxws-jbws2285.war");
-   }
-
-   public void setUp() throws Exception
-   {
-      super.setUp();
-      URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
-      QName serviceName = new QName("http://ws.jboss.org/jbws2285", "EndpointImplService");
-
-      Service service = Service.create(wsdlURL, serviceName);
-      port = service.getPort(Endpoint.class);
-   }
-
-   public void testCall() throws Exception
-   {
-      final String message = "Hello!!";
-      String response = port.echo(message);
-
-      // The logical handler should have replaced the incoming String.
-      assertEquals("XXX", response);
-   }
-
-   public void testSOAPConnection() throws Exception
-   {
-      SOAPMessage reqMsg = getRequestMessage();
-      URL epURL = new URL(TARGET_ENDPOINT_ADDRESS);
-      SOAPConnection con = SOAPConnectionFactory.newInstance().createConnection();
-      SOAPMessage resMsg = con.call(reqMsg, epURL);
-      SOAPEnvelope resEnv = resMsg.getSOAPPart().getEnvelope();
-
-      String response = "";
-
-      SOAPBody body = resEnv.getBody();
-      Iterator it = body.getChildElements(new QName("http://ws.jboss.org/jbws2285", "echoResponse"));
-      Node node = (Node)it.next();
-      NodeList nodes = node.getChildNodes();
-      for (int i = 0; i < nodes.getLength(); i++)
-      {
-         Node current = nodes.item(i);
-         if (current.getNodeName().equals("return"))
-         {
-            response = ((NodeImpl)current).getValue();
-         }
-      }
-
-      // The logical handler should have replaced the incoming String.
-      assertEquals("XXX", response);
-   }
-
-   private SOAPMessage getRequestMessage() throws SOAPException, IOException
-   {
-      URL reqMessage = new File("resources/jaxws/jbws2285/request-message.xml").toURL();
-      MessageFactory msgFactory = MessageFactory.newInstance();
-
-      SOAPMessage reqMsg = msgFactory.createMessage(null, reqMessage.openStream());
-      return reqMsg;
-   }
-
-}

Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/java/org/jboss/test/ws/jaxws/jbws2285/JBWS2285TestCase.java (from rev 8120, stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2285/JBWS2285TestCase.java)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/java/org/jboss/test/ws/jaxws/jbws2285/JBWS2285TestCase.java	                        (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/java/org/jboss/test/ws/jaxws/jbws2285/JBWS2285TestCase.java	2008-08-20 09:40:09 UTC (rev 8123)
@@ -0,0 +1,124 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.jbws2285;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.IOException;
+import java.net.URL;
+import java.util.Iterator;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPConnection;
+import javax.xml.soap.SOAPConnectionFactory;
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.jboss.ws.core.soap.NodeImpl;
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * [JBWS-2285] ClassCastException: org.jboss.ws.core.soap.TextImpl 
+ * in LogicalMessageImpl.getPayload.
+ * 
+ * @author darran.lofthouse at jboss.com
+ * @since 19th August 2008
+ * @see https://jira.jboss.org/jira/browse/JBWS-2285
+ */
+public class JBWS2285TestCase extends JBossWSTest
+{
+
+   public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() + ":8080/jaxws-jbws2285/";
+
+   private static Endpoint port;
+
+   public static Test suite() throws Exception
+   {
+      return new JBossWSTestSetup(JBWS2285TestCase.class, "jaxws-jbws2285.war");
+   }
+
+   public void setUp() throws Exception
+   {
+      super.setUp();
+      URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
+      QName serviceName = new QName("http://ws.jboss.org/jbws2285", "EndpointImplService");
+
+      Service service = Service.create(wsdlURL, serviceName);
+      port = service.getPort(Endpoint.class);
+   }
+
+   public void testCall() throws Exception
+   {
+      final String message = "Hello!!";
+      String response = port.echo(message);
+
+      // The logical handler should have replaced the incoming String.
+      assertEquals("XXX", response);
+   }
+
+   public void testSOAPConnection() throws Exception
+   {
+      SOAPMessage reqMsg = getRequestMessage();
+      URL epURL = new URL(TARGET_ENDPOINT_ADDRESS);
+      SOAPConnection con = SOAPConnectionFactory.newInstance().createConnection();
+      SOAPMessage resMsg = con.call(reqMsg, epURL);
+      SOAPEnvelope resEnv = resMsg.getSOAPPart().getEnvelope();
+
+      String response = "";
+
+      SOAPBody body = resEnv.getBody();
+      Iterator it = body.getChildElements(new QName("http://ws.jboss.org/jbws2285", "echoResponse"));
+      Node node = (Node)it.next();
+      NodeList nodes = node.getChildNodes();
+      for (int i = 0; i < nodes.getLength(); i++)
+      {
+         Node current = nodes.item(i);
+         if (current.getNodeName().equals("return"))
+         {
+            response = ((NodeImpl)current).getValue();
+         }
+      }
+
+      // The logical handler should have replaced the incoming String.
+      assertEquals("XXX", response);
+   }
+
+   private SOAPMessage getRequestMessage() throws SOAPException, IOException
+   {
+      URL reqMessage = new File("resources/jaxws/jbws2285/request-message.xml").toURL();
+      MessageFactory msgFactory = MessageFactory.newInstance();
+
+      SOAPMessage reqMsg = msgFactory.createMessage(null, reqMessage.openStream());
+      return reqMsg;
+   }
+
+}

Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/java/org/jboss/test/ws/jaxws/jbws2285/LogicalHandler.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2285/LogicalHandler.java	2008-08-19 17:50:57 UTC (rev 8120)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/java/org/jboss/test/ws/jaxws/jbws2285/LogicalHandler.java	2008-08-20 09:40:09 UTC (rev 8123)
@@ -1,80 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.jbws2285;
-
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.ws.LogicalMessage;
-import javax.xml.ws.handler.LogicalMessageContext;
-import javax.xml.ws.handler.MessageContext;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.wsf.common.DOMWriter;
-import org.jboss.wsf.test.GenericLogicalHandler;
-
-/**
- * Logical handler implementation.
- * 
- * @author darran.lofthouse at jboss.com
- * @since 19th August 2008
- */
-public class LogicalHandler extends GenericLogicalHandler
-{
-
-   private static final Logger log = Logger.getLogger(LogicalHandler.class);
-
-   @Override
-   protected boolean handleInbound(final MessageContext msgContext)
-   {
-      log.info("handleInbound()");
-
-      LogicalMessageContext lmc = (LogicalMessageContext)msgContext;
-      LogicalMessage message = lmc.getMessage();
-
-      Object payload = message.getPayload();
-
-      if (payload instanceof DOMSource == false)
-      {
-         throw new WSException("Test requires DOMSource payload");
-      }
-
-      DOMSource domPayload = (DOMSource)payload;
-      Node node = domPayload.getNode();
-
-      NodeList nodes = node.getChildNodes();
-      for (int i = 0; i < nodes.getLength(); i++)
-      {
-         Node current = nodes.item(i);
-         if ("arg0".equals(current.getLocalName()))
-         {
-            current.setTextContent("XXX");
-         }
-      }
-
-      log.info(DOMWriter.printNode(node, false));
-
-      return true;
-   }
-
-}

Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/java/org/jboss/test/ws/jaxws/jbws2285/LogicalHandler.java (from rev 8120, stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2285/LogicalHandler.java)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/java/org/jboss/test/ws/jaxws/jbws2285/LogicalHandler.java	                        (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/java/org/jboss/test/ws/jaxws/jbws2285/LogicalHandler.java	2008-08-20 09:40:09 UTC (rev 8123)
@@ -0,0 +1,80 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.jbws2285;
+
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.ws.LogicalMessage;
+import javax.xml.ws.handler.LogicalMessageContext;
+import javax.xml.ws.handler.MessageContext;
+
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.jboss.logging.Logger;
+import org.jboss.ws.WSException;
+import org.jboss.wsf.common.DOMWriter;
+import org.jboss.wsf.test.GenericLogicalHandler;
+
+/**
+ * Logical handler implementation.
+ * 
+ * @author darran.lofthouse at jboss.com
+ * @since 19th August 2008
+ */
+public class LogicalHandler extends GenericLogicalHandler
+{
+
+   private static final Logger log = Logger.getLogger(LogicalHandler.class);
+
+   @Override
+   protected boolean handleInbound(final MessageContext msgContext)
+   {
+      log.info("handleInbound()");
+
+      LogicalMessageContext lmc = (LogicalMessageContext)msgContext;
+      LogicalMessage message = lmc.getMessage();
+
+      Object payload = message.getPayload();
+
+      if (payload instanceof DOMSource == false)
+      {
+         throw new WSException("Test requires DOMSource payload");
+      }
+
+      DOMSource domPayload = (DOMSource)payload;
+      Node node = domPayload.getNode();
+
+      NodeList nodes = node.getChildNodes();
+      for (int i = 0; i < nodes.getLength(); i++)
+      {
+         Node current = nodes.item(i);
+         if ("arg0".equals(current.getLocalName()))
+         {
+            current.setTextContent("XXX");
+         }
+      }
+
+      log.info(DOMWriter.printNode(node, false));
+
+      return true;
+   }
+
+}

Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/resources/jaxws/jbws2285 (from rev 8120, stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2285)

Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/resources/jaxws/jbws2285/WEB-INF (from rev 8120, stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2285/WEB-INF)

Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/resources/jaxws/jbws2285/WEB-INF/jboss-web.xml
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2285/WEB-INF/jboss-web.xml	2008-08-19 17:50:57 UTC (rev 8120)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/resources/jaxws/jbws2285/WEB-INF/jboss-web.xml	2008-08-20 09:40:09 UTC (rev 8123)
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.4//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd">
-
-<jboss-web>
-   <context-root>/jaxws-jbws2285</context-root>   
-</jboss-web>
\ No newline at end of file

Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/resources/jaxws/jbws2285/WEB-INF/jboss-web.xml (from rev 8120, stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2285/WEB-INF/jboss-web.xml)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/resources/jaxws/jbws2285/WEB-INF/jboss-web.xml	                        (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/resources/jaxws/jbws2285/WEB-INF/jboss-web.xml	2008-08-20 09:40:09 UTC (rev 8123)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.4//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd">
+
+<jboss-web>
+   <context-root>/jaxws-jbws2285</context-root>   
+</jboss-web>
\ No newline at end of file

Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/resources/jaxws/jbws2285/WEB-INF/server-handlers.xml
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2285/WEB-INF/server-handlers.xml	2008-08-19 17:50:57 UTC (rev 8120)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/resources/jaxws/jbws2285/WEB-INF/server-handlers.xml	2008-08-20 09:40:09 UTC (rev 8123)
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<handler-chains xmlns="http://java.sun.com/xml/ns/javaee"
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xmlns:ns1="http://org.jboss.ws/jaxws/samples/logicalhandler"
-  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee javaee_web_services_1_2.xsd">
-  
-	<handler-chain>
-		<handler>
-			<handler-name> LogicalServerHandler </handler-name>
-			<handler-class> org.jboss.test.ws.jaxws.jbws2285.LogicalHandler </handler-class>
-		</handler>
-	</handler-chain>
-    
-</handler-chains>
\ No newline at end of file

Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/resources/jaxws/jbws2285/WEB-INF/server-handlers.xml (from rev 8120, stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2285/WEB-INF/server-handlers.xml)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/resources/jaxws/jbws2285/WEB-INF/server-handlers.xml	                        (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/resources/jaxws/jbws2285/WEB-INF/server-handlers.xml	2008-08-20 09:40:09 UTC (rev 8123)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<handler-chains xmlns="http://java.sun.com/xml/ns/javaee"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xmlns:ns1="http://org.jboss.ws/jaxws/samples/logicalhandler"
+  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee javaee_web_services_1_2.xsd">
+  
+	<handler-chain>
+		<handler>
+			<handler-name> LogicalServerHandler </handler-name>
+			<handler-class> org.jboss.test.ws.jaxws.jbws2285.LogicalHandler </handler-class>
+		</handler>
+	</handler-chain>
+    
+</handler-chains>
\ No newline at end of file

Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/resources/jaxws/jbws2285/WEB-INF/web.xml
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2285/WEB-INF/web.xml	2008-08-19 17:50:57 UTC (rev 8120)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/resources/jaxws/jbws2285/WEB-INF/web.xml	2008-08-20 09:40:09 UTC (rev 8123)
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
-
-   <servlet>
-      <servlet-name>Endpoint</servlet-name>
-      <servlet-class>org.jboss.test.ws.jaxws.jbws2285.EndpointImpl</servlet-class>
-   </servlet>
-   
-   <servlet-mapping>
-      <servlet-name>Endpoint</servlet-name>
-      <url-pattern>/*</url-pattern>
-   </servlet-mapping>
-
-</web-app>
\ No newline at end of file

Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/resources/jaxws/jbws2285/WEB-INF/web.xml (from rev 8120, stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2285/WEB-INF/web.xml)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/resources/jaxws/jbws2285/WEB-INF/web.xml	                        (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/resources/jaxws/jbws2285/WEB-INF/web.xml	2008-08-20 09:40:09 UTC (rev 8123)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+
+   <servlet>
+      <servlet-name>Endpoint</servlet-name>
+      <servlet-class>org.jboss.test.ws.jaxws.jbws2285.EndpointImpl</servlet-class>
+   </servlet>
+   
+   <servlet-mapping>
+      <servlet-name>Endpoint</servlet-name>
+      <url-pattern>/*</url-pattern>
+   </servlet-mapping>
+
+</web-app>
\ No newline at end of file

Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/resources/jaxws/jbws2285/request-message.xml
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2285/request-message.xml	2008-08-19 17:50:57 UTC (rev 8120)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/resources/jaxws/jbws2285/request-message.xml	2008-08-20 09:40:09 UTC (rev 8123)
@@ -1,8 +0,0 @@
-<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:jbw="http://ws.jboss.org/jbws2285">
-   <soapenv:Header/>
-   <soapenv:Body>
-      <jbw:echo>
-         <arg0>SSS</arg0>
-      </jbw:echo>
-   </soapenv:Body>
-</soapenv:Envelope>
\ No newline at end of file

Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/resources/jaxws/jbws2285/request-message.xml (from rev 8120, stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2285/request-message.xml)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/resources/jaxws/jbws2285/request-message.xml	                        (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/resources/jaxws/jbws2285/request-message.xml	2008-08-20 09:40:09 UTC (rev 8123)
@@ -0,0 +1,8 @@
+<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:jbw="http://ws.jboss.org/jbws2285">
+   <soapenv:Header/>
+   <soapenv:Body>
+      <jbw:echo>
+         <arg0>SSS</arg0>
+      </jbw:echo>
+   </soapenv:Body>
+</soapenv:Envelope>
\ No newline at end of file




More information about the jbossws-commits mailing list