JBossWS SVN: r8215 - in stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204: src/main/java/org/jboss/ws/core/soap and 5 other directories.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2008-09-23 15:00:14 -0400 (Tue, 23 Sep 2008)
New Revision: 8215
Added:
stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2319/
stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2319/Endpoint.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2319/EndpointImpl.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2319/JBWS2319TestCase.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2319/SOAPHandler.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2319/server-handlers.xml
stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2319/
stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2319/WEB-INF/
stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2319/WEB-INF/jboss-web.xml
stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2319/WEB-INF/web.xml
stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2319/request-message.xml
Removed:
stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2319/Endpoint.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2319/EndpointImpl.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2319/JBWS2319TestCase.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2319/SOAPHandler.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2319/server-handlers.xml
stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2319/WEB-INF/
stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2319/WEB-INF/jboss-web.xml
stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2319/WEB-INF/web.xml
stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2319/request-message.xml
Modified:
stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/ant-import-tests/build-jars-jaxws.xml
stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/main/java/org/jboss/ws/core/soap/NodeImpl.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/main/java/org/jboss/ws/core/soap/SOAPBodyImpl.java
Log:
[JBPAPP-1204] ClassCastException in SOAPBody.extractContentAsDocument()
Modified: stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/ant-import-tests/build-jars-jaxws.xml
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/ant-import-tests/build-jars-jaxws.xml 2008-09-23 18:55:54 UTC (rev 8214)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/ant-import-tests/build-jars-jaxws.xml 2008-09-23 19:00:14 UTC (rev 8215)
@@ -460,6 +460,18 @@
</webinf>
</war>
+ <!-- jaxws-jbws2319 -->
+ <war warfile="${tests.output.dir}/libs/jaxws-jbws2319.war" webxml="${tests.output.dir}/resources/jaxws/jbws2319/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/classes">
+ <include name="org/jboss/test/ws/jaxws/jbws2319/*.class"/>
+ <exclude name="org/jboss/test/ws/jaxws/jbws2319/JBWS2285TestCase.class"/>
+ <include name="org/jboss/test/ws/jaxws/jbws2319/server-handlers.xml"/>
+ </classes>
+ <webinf dir="${tests.output.dir}/resources/jaxws/jbws2319/WEB-INF">
+ <include name="jboss-web.xml"/>
+ </webinf>
+ </war>
+
<!-- jaxws-jbws1809 -->
<jar destfile="${tests.output.dir}/libs/jaxws-jbws1809.jar">
<fileset dir="${tests.output.dir}/classes">
Modified: stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/main/java/org/jboss/ws/core/soap/NodeImpl.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/main/java/org/jboss/ws/core/soap/NodeImpl.java 2008-09-23 18:55:54 UTC (rev 8214)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/main/java/org/jboss/ws/core/soap/NodeImpl.java 2008-09-23 19:00:14 UTC (rev 8215)
@@ -44,13 +44,13 @@
/**
* A representation of a node (element) in an XML document.
- * This interface extnends the standard DOM Node interface with methods for getting and setting the value of a node,
+ * This interface extends the standard DOM Node interface with methods for getting and setting the value of a node,
* for getting and setting the parent of a node, and for removing a node.
*
* When creating a DOM2 tree the objects maintained by the tree are <code>org.w3c.dom.Node</code> objects
* and not <code>javax.xml.soap.Node</code> objects.
* <p/>
- * This implementation schields the client from the the underlying DOM2 tree, returning <code>javax.xml.soap.Node</code>
+ * This implementation shields the client from the the underlying DOM2 tree, returning <code>javax.xml.soap.Node</code>
* objects.
*
* @author Thomas.Diesler(a)jboss.org
Modified: stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/main/java/org/jboss/ws/core/soap/SOAPBodyImpl.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/main/java/org/jboss/ws/core/soap/SOAPBodyImpl.java 2008-09-23 18:55:54 UTC (rev 8214)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/main/java/org/jboss/ws/core/soap/SOAPBodyImpl.java 2008-09-23 19:00:14 UTC (rev 8215)
@@ -68,7 +68,7 @@
public SOAPElement addChildElement(SOAPElement child) throws SOAPException
{
log.trace("addChildElement: " + child.getElementName());
-
+
if ((child instanceof SOAPBodyElement) == false)
child = convertToBodyElement(child);
@@ -194,7 +194,7 @@
}
return bodyElement;
}
-
+
public Node appendChild(Node newChild) throws DOMException
{
log.trace("appendChild: " + newChild.getNodeName());
@@ -238,22 +238,33 @@
Iterator childElements = getChildElements();
+ SOAPElementImpl childElement = null;
+
+ while (childElements.hasNext() == true)
+ {
+ Object current = childElements.next();
+ if (current instanceof SOAPElementImpl)
+ childElement = (SOAPElementImpl)current;
+ }
+
// zero child elements?
- if (!childElements.hasNext())
+ if (childElement == null)
throw new SOAPException("Cannot find SOAPBodyElement");
- SOAPElementImpl childElement = (SOAPElementImpl)childElements.next();
-
// more than one child element?
- if (childElements.hasNext())
- throw new SOAPException("Multiple SOAPBodyElement");
+ while (childElements.hasNext() == true)
+ {
+ Object current = childElements.next();
+ if (current instanceof SOAPElementImpl)
+ throw new SOAPException("Multiple SOAPBodyElement");
+ }
if (childElement instanceof SOAPContentElement)
{
// cause expansion to DOM
SOAPContentElement contentElement = (SOAPContentElement)childElement;
// TODO change visibility of SOAPContentElement.expandToDOM() to package?
- contentElement.getPayload();
+ contentElement.hasChildNodes();
}
// child SOAPElement is removed as part of this process
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2319 (from rev 8214, stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2319)
Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2319/Endpoint.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2319/Endpoint.java 2008-09-23 18:55:54 UTC (rev 8214)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2319/Endpoint.java 2008-09-23 19:00:14 UTC (rev 8215)
@@ -1,38 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, 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.jbws2319;
-
-import javax.jws.WebService;
-
-/**
- * Test Endpoint.
- *
- * @author darran.lofthouse(a)jboss.com
- * @since 23rd September 2008
- */
-@WebService(name = "Endpoint", targetNamespace = "http://ws.jboss.org/jbws2319")
-public interface Endpoint
-{
-
- public String echo(final String message);
-
-}
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2319/Endpoint.java (from rev 8214, stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2319/Endpoint.java)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2319/Endpoint.java (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2319/Endpoint.java 2008-09-23 19:00:14 UTC (rev 8215)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, 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.jbws2319;
+
+import javax.jws.WebService;
+
+/**
+ * Test Endpoint.
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 23rd September 2008
+ */
+@WebService(name = "Endpoint", targetNamespace = "http://ws.jboss.org/jbws2319")
+public interface Endpoint
+{
+
+ public String echo(final String message);
+
+}
Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2319/EndpointImpl.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2319/EndpointImpl.java 2008-09-23 18:55:54 UTC (rev 8214)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2319/EndpointImpl.java 2008-09-23 19:00:14 UTC (rev 8215)
@@ -1,47 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, 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.jbws2319;
-
-import javax.jws.HandlerChain;
-import javax.jws.WebService;
-
-import org.jboss.logging.Logger;
-
-/**
- * Test Endpoint implementation.
- *
- * @author darran.lofthouse(a)jboss.com
- * @since 23rd September 2008
- */
-@WebService(name = "Endpoint", targetNamespace = "http://ws.jboss.org/jbws2319", endpointInterface = "org.jboss.test.ws.jaxws.jbws2319.Endpoint")
-@HandlerChain(file = "server-handlers.xml")
-public class EndpointImpl implements Endpoint
-{
- private static final Logger log = Logger.getLogger(EndpointImpl.class);
-
- public String echo(final String message)
- {
- log.info("Value to echo '" + message + "'");
- return message;
- }
-
-}
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2319/EndpointImpl.java (from rev 8214, stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2319/EndpointImpl.java)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2319/EndpointImpl.java (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2319/EndpointImpl.java 2008-09-23 19:00:14 UTC (rev 8215)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, 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.jbws2319;
+
+import javax.jws.HandlerChain;
+import javax.jws.WebService;
+
+import org.jboss.logging.Logger;
+
+/**
+ * Test Endpoint implementation.
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 23rd September 2008
+ */
+@WebService(name = "Endpoint", targetNamespace = "http://ws.jboss.org/jbws2319", endpointInterface = "org.jboss.test.ws.jaxws.jbws2319.Endpoint")
+@HandlerChain(file = "server-handlers.xml")
+public class EndpointImpl implements Endpoint
+{
+ private static final Logger log = Logger.getLogger(EndpointImpl.class);
+
+ public String echo(final String message)
+ {
+ log.info("Value to echo '" + message + "'");
+ return message;
+ }
+
+}
Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2319/JBWS2319TestCase.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2319/JBWS2319TestCase.java 2008-09-23 18:55:54 UTC (rev 8214)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2319/JBWS2319TestCase.java 2008-09-23 19:00:14 UTC (rev 8215)
@@ -1,122 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, 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.jbws2319;
-
-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-2319] ClassCastException: org.jboss.ws.core.soap.TextImpl
- * in SOAPBody.extractContentAsDocument();
- *
- * @author darran.lofthouse(a)jboss.com
- * @since 23rd September 2008
- * @see https://jira.jboss.org/jira/browse/JBWS-2319
- */
-public class JBWS2319TestCase extends JBossWSTest
-{
-
- public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() + ":8080/jaxws-jbws2319/";
-
- private static Endpoint port;
-
- public static Test suite() throws Exception
- {
- return new JBossWSTestSetup(JBWS2319TestCase.class, "jaxws-jbws2319.war");
- }
-
- public void setUp() throws Exception
- {
- super.setUp();
- URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
- QName serviceName = new QName("http://ws.jboss.org/jbws2319", "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/jbws2319", "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/jbws2319/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_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2319/JBWS2319TestCase.java (from rev 8214, stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2319/JBWS2319TestCase.java)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2319/JBWS2319TestCase.java (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2319/JBWS2319TestCase.java 2008-09-23 19:00:14 UTC (rev 8215)
@@ -0,0 +1,122 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, 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.jbws2319;
+
+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-2319] ClassCastException: org.jboss.ws.core.soap.TextImpl
+ * in SOAPBody.extractContentAsDocument();
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 23rd September 2008
+ * @see https://jira.jboss.org/jira/browse/JBWS-2319
+ */
+public class JBWS2319TestCase extends JBossWSTest
+{
+
+ public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() + ":8080/jaxws-jbws2319/";
+
+ private static Endpoint port;
+
+ public static Test suite() throws Exception
+ {
+ return new JBossWSTestSetup(JBWS2319TestCase.class, "jaxws-jbws2319.war");
+ }
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
+ QName serviceName = new QName("http://ws.jboss.org/jbws2319", "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/jbws2319", "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/jbws2319/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_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2319/SOAPHandler.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2319/SOAPHandler.java 2008-09-23 18:55:54 UTC (rev 8214)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2319/SOAPHandler.java 2008-09-23 19:00:14 UTC (rev 8215)
@@ -1,99 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, 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.jbws2319;
-
-import javax.xml.soap.SOAPBody;
-import javax.xml.soap.SOAPElementFactory;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.ws.handler.LogicalMessageContext;
-import javax.xml.ws.handler.MessageContext;
-import javax.xml.ws.handler.soap.SOAPMessageContext;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.jaxws.handler.GenericSOAPHandler;
-import org.jboss.wsf.common.DOMWriter;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * Logical handler implementation.
- *
- * @author darran.lofthouse(a)jboss.com
- * @since 23rd September 2008
- */
-public class SOAPHandler extends GenericSOAPHandler<LogicalMessageContext>
-{
-
- private static final Logger log = Logger.getLogger(SOAPHandler.class);
-
- @Override
- protected boolean handleInbound(final MessageContext msgContext)
- {
- log.info("handleInbound()");
-
- try
- {
- SOAPMessageContext smc = (SOAPMessageContext)msgContext;
- SOAPMessage message = smc.getMessage();
-
- SOAPBody body = message.getSOAPBody();
- Document document = body.extractContentAsDocument();
- Node node = document;
-
- log.info(DOMWriter.printNode(node, false));
-
- NodeList nodes = node.getChildNodes();
- for (int i = 0; i < nodes.getLength(); i++)
- {
- Node current = nodes.item(i);
-
- NodeList childNodes = current.getChildNodes();
- for (int j = 0; j < childNodes.getLength(); j++)
- {
- Node currentChildNode = childNodes.item(j);
- if ("arg0".equals(currentChildNode.getLocalName()))
- {
- log.info("Replacing " + currentChildNode.getTextContent() + " with XXX");
- currentChildNode.setTextContent("XXX");
- }
- }
- }
-
- log.info(DOMWriter.printNode(node, false));
-
- // Add document back as removed by call to 'extractContentAsDocument()'
- body.addDocument(document);
- message.saveChanges();
- }
- catch (SOAPException e)
- {
- throw new WSException("Error in Handler", e);
- }
-
- log.info("Finished");
- return true;
- }
-
-}
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2319/SOAPHandler.java (from rev 8214, stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2319/SOAPHandler.java)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2319/SOAPHandler.java (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2319/SOAPHandler.java 2008-09-23 19:00:14 UTC (rev 8215)
@@ -0,0 +1,99 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, 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.jbws2319;
+
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPElementFactory;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.handler.LogicalMessageContext;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.jaxws.handler.GenericSOAPHandler;
+import org.jboss.wsf.common.DOMWriter;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * Logical handler implementation.
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 23rd September 2008
+ */
+public class SOAPHandler extends GenericSOAPHandler<LogicalMessageContext>
+{
+
+ private static final Logger log = Logger.getLogger(SOAPHandler.class);
+
+ @Override
+ protected boolean handleInbound(final MessageContext msgContext)
+ {
+ log.info("handleInbound()");
+
+ try
+ {
+ SOAPMessageContext smc = (SOAPMessageContext)msgContext;
+ SOAPMessage message = smc.getMessage();
+
+ SOAPBody body = message.getSOAPBody();
+ Document document = body.extractContentAsDocument();
+ Node node = document;
+
+ log.info(DOMWriter.printNode(node, false));
+
+ NodeList nodes = node.getChildNodes();
+ for (int i = 0; i < nodes.getLength(); i++)
+ {
+ Node current = nodes.item(i);
+
+ NodeList childNodes = current.getChildNodes();
+ for (int j = 0; j < childNodes.getLength(); j++)
+ {
+ Node currentChildNode = childNodes.item(j);
+ if ("arg0".equals(currentChildNode.getLocalName()))
+ {
+ log.info("Replacing " + currentChildNode.getTextContent() + " with XXX");
+ currentChildNode.setTextContent("XXX");
+ }
+ }
+ }
+
+ log.info(DOMWriter.printNode(node, false));
+
+ // Add document back as removed by call to 'extractContentAsDocument()'
+ body.addDocument(document);
+ message.saveChanges();
+ }
+ catch (SOAPException e)
+ {
+ throw new WSException("Error in Handler", e);
+ }
+
+ log.info("Finished");
+ return true;
+ }
+
+}
Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2319/server-handlers.xml
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2319/server-handlers.xml 2008-09-23 18:55:54 UTC (rev 8214)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2319/server-handlers.xml 2008-09-23 19:00:14 UTC (rev 8215)
@@ -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> SOAPServerHandler </handler-name>
- <handler-class> org.jboss.test.ws.jaxws.jbws2319.SOAPHandler </handler-class>
- </handler>
- </handler-chain>
-
-</handler-chains>
\ No newline at end of file
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2319/server-handlers.xml (from rev 8214, stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2319/server-handlers.xml)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2319/server-handlers.xml (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2319/server-handlers.xml 2008-09-23 19:00:14 UTC (rev 8215)
@@ -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> SOAPServerHandler </handler-name>
+ <handler-class> org.jboss.test.ws.jaxws.jbws2319.SOAPHandler </handler-class>
+ </handler>
+ </handler-chain>
+
+</handler-chains>
\ No newline at end of file
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2319 (from rev 8214, stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2319)
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2319/WEB-INF (from rev 8214, stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2319/WEB-INF)
Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2319/WEB-INF/jboss-web.xml
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2319/WEB-INF/jboss-web.xml 2008-09-23 18:55:54 UTC (rev 8214)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2319/WEB-INF/jboss-web.xml 2008-09-23 19:00:14 UTC (rev 8215)
@@ -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-jbws2319</context-root>
-</jboss-web>
\ No newline at end of file
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2319/WEB-INF/jboss-web.xml (from rev 8214, stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2319/WEB-INF/jboss-web.xml)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2319/WEB-INF/jboss-web.xml (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2319/WEB-INF/jboss-web.xml 2008-09-23 19:00:14 UTC (rev 8215)
@@ -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-jbws2319</context-root>
+</jboss-web>
\ No newline at end of file
Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2319/WEB-INF/web.xml
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2319/WEB-INF/web.xml 2008-09-23 18:55:54 UTC (rev 8214)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2319/WEB-INF/web.xml 2008-09-23 19:00:14 UTC (rev 8215)
@@ -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.jbws2319.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_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2319/WEB-INF/web.xml (from rev 8214, stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2319/WEB-INF/web.xml)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2319/WEB-INF/web.xml (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2319/WEB-INF/web.xml 2008-09-23 19:00:14 UTC (rev 8215)
@@ -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.jbws2319.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_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2319/request-message.xml
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2319/request-message.xml 2008-09-23 18:55:54 UTC (rev 8214)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2319/request-message.xml 2008-09-23 19:00:14 UTC (rev 8215)
@@ -1,8 +0,0 @@
-<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:jbw="http://ws.jboss.org/jbws2319">
- <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_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2319/request-message.xml (from rev 8214, stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2319/request-message.xml)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2319/request-message.xml (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2319/request-message.xml 2008-09-23 19:00:14 UTC (rev 8215)
@@ -0,0 +1,8 @@
+<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:jbw="http://ws.jboss.org/jbws2319">
+ <soapenv:Header/>
+ <soapenv:Body>
+ <jbw:echo>
+ <arg0>SSS</arg0>
+ </jbw:echo>
+ </soapenv:Body>
+</soapenv:Envelope>
\ No newline at end of file
15 years, 8 months
JBossWS SVN: r8214 - in stack/native/branches/jbossws-native-2.0.1.SP2_CP: src/main/java/org/jboss/ws/core/soap and 5 other directories.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2008-09-23 14:55:54 -0400 (Tue, 23 Sep 2008)
New Revision: 8214
Added:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2319/
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2319/Endpoint.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2319/EndpointImpl.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2319/JBWS2319TestCase.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2319/SOAPHandler.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2319/server-handlers.xml
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2319/
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2319/WEB-INF/
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2319/WEB-INF/jboss-web.xml
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2319/WEB-INF/web.xml
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2319/request-message.xml
Removed:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2319/Endpoint.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2319/EndpointImpl.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2319/JBWS2319TestCase.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2319/SOAPHandler.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2319/server-handlers.xml
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2319/WEB-INF/
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2319/WEB-INF/jboss-web.xml
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2319/WEB-INF/web.xml
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2319/request-message.xml
Modified:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/ant-import-tests/build-jars-jaxws.xml
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/core/soap/NodeImpl.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/core/soap/SOAPBodyImpl.java
Log:
[JBPAPP-1202] ClassCastException in SOAPBody.extractContentAsDocument()
Modified: stack/native/branches/jbossws-native-2.0.1.SP2_CP/ant-import-tests/build-jars-jaxws.xml
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/ant-import-tests/build-jars-jaxws.xml 2008-09-23 18:53:37 UTC (rev 8213)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/ant-import-tests/build-jars-jaxws.xml 2008-09-23 18:55:54 UTC (rev 8214)
@@ -532,7 +532,19 @@
<include name="jboss-web.xml"/>
<include name="server-handlers.xml"/>
</webinf>
- </war>
+ </war>
+
+ <!-- jaxws-jbws2319 -->
+ <war warfile="${tests.output.dir}/libs/jaxws-jbws2319.war" webxml="${tests.output.dir}/resources/jaxws/jbws2319/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/classes">
+ <include name="org/jboss/test/ws/jaxws/jbws2319/*.class"/>
+ <exclude name="org/jboss/test/ws/jaxws/jbws2319/JBWS2285TestCase.class"/>
+ <include name="org/jboss/test/ws/jaxws/jbws2319/server-handlers.xml"/>
+ </classes>
+ <webinf dir="${tests.output.dir}/resources/jaxws/jbws2319/WEB-INF">
+ <include name="jboss-web.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_CP/src/main/java/org/jboss/ws/core/soap/NodeImpl.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/core/soap/NodeImpl.java 2008-09-23 18:53:37 UTC (rev 8213)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/core/soap/NodeImpl.java 2008-09-23 18:55:54 UTC (rev 8214)
@@ -44,13 +44,13 @@
/**
* A representation of a node (element) in an XML document.
- * This interface extnends the standard DOM Node interface with methods for getting and setting the value of a node,
+ * This interface extends the standard DOM Node interface with methods for getting and setting the value of a node,
* for getting and setting the parent of a node, and for removing a node.
*
* When creating a DOM2 tree the objects maintained by the tree are <code>org.w3c.dom.Node</code> objects
* and not <code>javax.xml.soap.Node</code> objects.
* <p/>
- * This implementation schields the client from the the underlying DOM2 tree, returning <code>javax.xml.soap.Node</code>
+ * This implementation shields the client from the the underlying DOM2 tree, returning <code>javax.xml.soap.Node</code>
* objects.
*
* @author Thomas.Diesler(a)jboss.org
Modified: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/core/soap/SOAPBodyImpl.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/core/soap/SOAPBodyImpl.java 2008-09-23 18:53:37 UTC (rev 8213)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/core/soap/SOAPBodyImpl.java 2008-09-23 18:55:54 UTC (rev 8214)
@@ -68,7 +68,7 @@
public SOAPElement addChildElement(SOAPElement child) throws SOAPException
{
log.trace("addChildElement: " + child.getElementName());
-
+
if ((child instanceof SOAPBodyElement) == false)
child = convertToBodyElement(child);
@@ -194,7 +194,7 @@
}
return bodyElement;
}
-
+
public Node appendChild(Node newChild) throws DOMException
{
log.trace("appendChild: " + newChild.getNodeName());
@@ -238,22 +238,33 @@
Iterator childElements = getChildElements();
+ SOAPElementImpl childElement = null;
+
+ while (childElements.hasNext() == true)
+ {
+ Object current = childElements.next();
+ if (current instanceof SOAPElementImpl)
+ childElement = (SOAPElementImpl)current;
+ }
+
// zero child elements?
- if (!childElements.hasNext())
+ if (childElement == null)
throw new SOAPException("Cannot find SOAPBodyElement");
- SOAPElementImpl childElement = (SOAPElementImpl)childElements.next();
-
// more than one child element?
- if (childElements.hasNext())
- throw new SOAPException("Multiple SOAPBodyElement");
+ while (childElements.hasNext() == true)
+ {
+ Object current = childElements.next();
+ if (current instanceof SOAPElementImpl)
+ throw new SOAPException("Multiple SOAPBodyElement");
+ }
if (childElement instanceof SOAPContentElement)
{
// cause expansion to DOM
SOAPContentElement contentElement = (SOAPContentElement)childElement;
// TODO change visibility of SOAPContentElement.expandToDOM() to package?
- contentElement.getPayload();
+ contentElement.hasChildNodes();
}
// child SOAPElement is removed as part of this process
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2319 (from rev 8207, stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319)
Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2319/Endpoint.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/Endpoint.java 2008-09-23 18:00:00 UTC (rev 8207)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2319/Endpoint.java 2008-09-23 18:55:54 UTC (rev 8214)
@@ -1,38 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, 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.jbws2319;
-
-import javax.jws.WebService;
-
-/**
- * Test Endpoint.
- *
- * @author darran.lofthouse(a)jboss.com
- * @since 23rd September 2008
- */
-@WebService(name = "Endpoint", targetNamespace = "http://ws.jboss.org/jbws2319")
-public interface Endpoint
-{
-
- public String echo(final String message);
-
-}
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2319/Endpoint.java (from rev 8207, stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/Endpoint.java)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2319/Endpoint.java (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2319/Endpoint.java 2008-09-23 18:55:54 UTC (rev 8214)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, 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.jbws2319;
+
+import javax.jws.WebService;
+
+/**
+ * Test Endpoint.
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 23rd September 2008
+ */
+@WebService(name = "Endpoint", targetNamespace = "http://ws.jboss.org/jbws2319")
+public interface Endpoint
+{
+
+ public String echo(final String message);
+
+}
Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2319/EndpointImpl.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/EndpointImpl.java 2008-09-23 18:00:00 UTC (rev 8207)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2319/EndpointImpl.java 2008-09-23 18:55:54 UTC (rev 8214)
@@ -1,47 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, 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.jbws2319;
-
-import javax.jws.HandlerChain;
-import javax.jws.WebService;
-
-import org.jboss.logging.Logger;
-
-/**
- * Test Endpoint implementation.
- *
- * @author darran.lofthouse(a)jboss.com
- * @since 23rd September 2008
- */
-@WebService(name = "Endpoint", targetNamespace = "http://ws.jboss.org/jbws2319", endpointInterface = "org.jboss.test.ws.jaxws.jbws2319.Endpoint")
-@HandlerChain(file = "server-handlers.xml")
-public class EndpointImpl implements Endpoint
-{
- private static final Logger log = Logger.getLogger(EndpointImpl.class);
-
- public String echo(final String message)
- {
- log.info("Value to echo '" + message + "'");
- return message;
- }
-
-}
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2319/EndpointImpl.java (from rev 8207, stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/EndpointImpl.java)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2319/EndpointImpl.java (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2319/EndpointImpl.java 2008-09-23 18:55:54 UTC (rev 8214)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, 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.jbws2319;
+
+import javax.jws.HandlerChain;
+import javax.jws.WebService;
+
+import org.jboss.logging.Logger;
+
+/**
+ * Test Endpoint implementation.
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 23rd September 2008
+ */
+@WebService(name = "Endpoint", targetNamespace = "http://ws.jboss.org/jbws2319", endpointInterface = "org.jboss.test.ws.jaxws.jbws2319.Endpoint")
+@HandlerChain(file = "server-handlers.xml")
+public class EndpointImpl implements Endpoint
+{
+ private static final Logger log = Logger.getLogger(EndpointImpl.class);
+
+ public String echo(final String message)
+ {
+ log.info("Value to echo '" + message + "'");
+ return message;
+ }
+
+}
Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2319/JBWS2319TestCase.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/JBWS2319TestCase.java 2008-09-23 18:00:00 UTC (rev 8207)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2319/JBWS2319TestCase.java 2008-09-23 18:55:54 UTC (rev 8214)
@@ -1,121 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, 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.jbws2319;
-
-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-2319] ClassCastException: org.jboss.ws.core.soap.TextImpl
- * in SOAPBody.extractContentAsDocument();
- *
- * @author darran.lofthouse(a)jboss.com
- * @since 23rd September 2008
- * @see https://jira.jboss.org/jira/browse/JBWS-2319
- */
-public class JBWS2319TestCase extends JBossWSTest
-{
-
- public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() + ":8080/jaxws-jbws2319/";
-
- private static Endpoint port;
-
- public static Test suite() throws Exception
- {
- return new JBossWSTestSetup(JBWS2319TestCase.class, "jaxws-jbws2319.war");
- }
-
- public void setUp() throws Exception
- {
- super.setUp();
- URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
- QName serviceName = new QName("http://ws.jboss.org/jbws2319", "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/jbws2319", "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 = getResourceFile("jaxws/jbws2319/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_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2319/JBWS2319TestCase.java (from rev 8207, stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/JBWS2319TestCase.java)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2319/JBWS2319TestCase.java (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2319/JBWS2319TestCase.java 2008-09-23 18:55:54 UTC (rev 8214)
@@ -0,0 +1,122 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, 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.jbws2319;
+
+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-2319] ClassCastException: org.jboss.ws.core.soap.TextImpl
+ * in SOAPBody.extractContentAsDocument();
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 23rd September 2008
+ * @see https://jira.jboss.org/jira/browse/JBWS-2319
+ */
+public class JBWS2319TestCase extends JBossWSTest
+{
+
+ public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() + ":8080/jaxws-jbws2319/";
+
+ private static Endpoint port;
+
+ public static Test suite() throws Exception
+ {
+ return new JBossWSTestSetup(JBWS2319TestCase.class, "jaxws-jbws2319.war");
+ }
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
+ QName serviceName = new QName("http://ws.jboss.org/jbws2319", "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/jbws2319", "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/jbws2319/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_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2319/SOAPHandler.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/SOAPHandler.java 2008-09-23 18:00:00 UTC (rev 8207)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2319/SOAPHandler.java 2008-09-23 18:55:54 UTC (rev 8214)
@@ -1,99 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, 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.jbws2319;
-
-import javax.xml.soap.SOAPBody;
-import javax.xml.soap.SOAPElementFactory;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.ws.handler.LogicalMessageContext;
-import javax.xml.ws.handler.MessageContext;
-import javax.xml.ws.handler.soap.SOAPMessageContext;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.wsf.common.DOMWriter;
-import org.jboss.wsf.common.handler.GenericSOAPHandler;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * Logical handler implementation.
- *
- * @author darran.lofthouse(a)jboss.com
- * @since 23rd September 2008
- */
-public class SOAPHandler extends GenericSOAPHandler<LogicalMessageContext>
-{
-
- private static final Logger log = Logger.getLogger(SOAPHandler.class);
-
- @Override
- protected boolean handleInbound(final MessageContext msgContext)
- {
- log.info("handleInbound()");
-
- try
- {
- SOAPMessageContext smc = (SOAPMessageContext)msgContext;
- SOAPMessage message = smc.getMessage();
-
- SOAPBody body = message.getSOAPBody();
- Document document = body.extractContentAsDocument();
- Node node = document;
-
- log.info(DOMWriter.printNode(node, false));
-
- NodeList nodes = node.getChildNodes();
- for (int i = 0; i < nodes.getLength(); i++)
- {
- Node current = nodes.item(i);
-
- NodeList childNodes = current.getChildNodes();
- for (int j = 0; j < childNodes.getLength(); j++)
- {
- Node currentChildNode = childNodes.item(j);
- if ("arg0".equals(currentChildNode.getLocalName()))
- {
- log.info("Replacing " + currentChildNode.getTextContent() + " with XXX");
- currentChildNode.setTextContent("XXX");
- }
- }
- }
-
- log.info(DOMWriter.printNode(node, false));
-
- // Add document back as removed by call to 'extractContentAsDocument()'
- body.addDocument(document);
- message.saveChanges();
- }
- catch (SOAPException e)
- {
- throw new WSException("Error in Handler", e);
- }
-
- log.info("Finished");
- return true;
- }
-
-}
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2319/SOAPHandler.java (from rev 8207, stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/SOAPHandler.java)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2319/SOAPHandler.java (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2319/SOAPHandler.java 2008-09-23 18:55:54 UTC (rev 8214)
@@ -0,0 +1,99 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, 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.jbws2319;
+
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPElementFactory;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.handler.LogicalMessageContext;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.jaxws.handler.GenericSOAPHandler;
+import org.jboss.wsf.common.DOMWriter;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * Logical handler implementation.
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 23rd September 2008
+ */
+public class SOAPHandler extends GenericSOAPHandler<LogicalMessageContext>
+{
+
+ private static final Logger log = Logger.getLogger(SOAPHandler.class);
+
+ @Override
+ protected boolean handleInbound(final MessageContext msgContext)
+ {
+ log.info("handleInbound()");
+
+ try
+ {
+ SOAPMessageContext smc = (SOAPMessageContext)msgContext;
+ SOAPMessage message = smc.getMessage();
+
+ SOAPBody body = message.getSOAPBody();
+ Document document = body.extractContentAsDocument();
+ Node node = document;
+
+ log.info(DOMWriter.printNode(node, false));
+
+ NodeList nodes = node.getChildNodes();
+ for (int i = 0; i < nodes.getLength(); i++)
+ {
+ Node current = nodes.item(i);
+
+ NodeList childNodes = current.getChildNodes();
+ for (int j = 0; j < childNodes.getLength(); j++)
+ {
+ Node currentChildNode = childNodes.item(j);
+ if ("arg0".equals(currentChildNode.getLocalName()))
+ {
+ log.info("Replacing " + currentChildNode.getTextContent() + " with XXX");
+ currentChildNode.setTextContent("XXX");
+ }
+ }
+ }
+
+ log.info(DOMWriter.printNode(node, false));
+
+ // Add document back as removed by call to 'extractContentAsDocument()'
+ body.addDocument(document);
+ message.saveChanges();
+ }
+ catch (SOAPException e)
+ {
+ throw new WSException("Error in Handler", e);
+ }
+
+ log.info("Finished");
+ return true;
+ }
+
+}
Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2319/server-handlers.xml
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/server-handlers.xml 2008-09-23 18:00:00 UTC (rev 8207)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2319/server-handlers.xml 2008-09-23 18:55:54 UTC (rev 8214)
@@ -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> SOAPServerHandler </handler-name>
- <handler-class> org.jboss.test.ws.jaxws.jbws2319.SOAPHandler </handler-class>
- </handler>
- </handler-chain>
-
-</handler-chains>
\ No newline at end of file
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2319/server-handlers.xml (from rev 8207, stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/server-handlers.xml)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2319/server-handlers.xml (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws2319/server-handlers.xml 2008-09-23 18:55:54 UTC (rev 8214)
@@ -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> SOAPServerHandler </handler-name>
+ <handler-class> org.jboss.test.ws.jaxws.jbws2319.SOAPHandler </handler-class>
+ </handler>
+ </handler-chain>
+
+</handler-chains>
\ No newline at end of file
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2319 (from rev 8207, stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2319)
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2319/WEB-INF (from rev 8207, stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2319/WEB-INF)
Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2319/WEB-INF/jboss-web.xml
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2319/WEB-INF/jboss-web.xml 2008-09-23 18:00:00 UTC (rev 8207)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2319/WEB-INF/jboss-web.xml 2008-09-23 18:55:54 UTC (rev 8214)
@@ -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-jbws2319</context-root>
-</jboss-web>
\ No newline at end of file
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2319/WEB-INF/jboss-web.xml (from rev 8207, stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2319/WEB-INF/jboss-web.xml)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2319/WEB-INF/jboss-web.xml (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2319/WEB-INF/jboss-web.xml 2008-09-23 18:55:54 UTC (rev 8214)
@@ -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-jbws2319</context-root>
+</jboss-web>
\ No newline at end of file
Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2319/WEB-INF/web.xml
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2319/WEB-INF/web.xml 2008-09-23 18:00:00 UTC (rev 8207)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2319/WEB-INF/web.xml 2008-09-23 18:55:54 UTC (rev 8214)
@@ -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.jbws2319.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_CP/src/test/resources/jaxws/jbws2319/WEB-INF/web.xml (from rev 8207, stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2319/WEB-INF/web.xml)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2319/WEB-INF/web.xml (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2319/WEB-INF/web.xml 2008-09-23 18:55:54 UTC (rev 8214)
@@ -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.jbws2319.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_CP/src/test/resources/jaxws/jbws2319/request-message.xml
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2319/request-message.xml 2008-09-23 18:00:00 UTC (rev 8207)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2319/request-message.xml 2008-09-23 18:55:54 UTC (rev 8214)
@@ -1,8 +0,0 @@
-<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:jbw="http://ws.jboss.org/jbws2319">
- <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_CP/src/test/resources/jaxws/jbws2319/request-message.xml (from rev 8207, stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2319/request-message.xml)
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2319/request-message.xml (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws2319/request-message.xml 2008-09-23 18:55:54 UTC (rev 8214)
@@ -0,0 +1,8 @@
+<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:jbw="http://ws.jboss.org/jbws2319">
+ <soapenv:Header/>
+ <soapenv:Body>
+ <jbw:echo>
+ <arg0>SSS</arg0>
+ </jbw:echo>
+ </soapenv:Body>
+</soapenv:Envelope>
\ No newline at end of file
15 years, 8 months
JBossWS SVN: r8213 - in stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204: src/main/java/org/jboss/ws/core/jaxws/handler and 5 other directories.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2008-09-23 14:53:37 -0400 (Tue, 23 Sep 2008)
New Revision: 8213
Added:
stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2285/
stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2285/Endpoint.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2285/EndpointImpl.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2285/JBWS2285TestCase.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2285/LogicalHandler.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2285/
stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2285/WEB-INF/
stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2285/WEB-INF/jboss-web.xml
stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2285/WEB-INF/server-handlers.xml
stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2285/WEB-INF/web.xml
stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2285/request-message.xml
Removed:
stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2285/Endpoint.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2285/EndpointImpl.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2285/JBWS2285TestCase.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2285/LogicalHandler.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2285/WEB-INF/
stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2285/WEB-INF/jboss-web.xml
stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2285/WEB-INF/server-handlers.xml
stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2285/WEB-INF/web.xml
stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2285/request-message.xml
Modified:
stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/ant-import-tests/build-jars-jaxws.xml
stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/main/java/org/jboss/ws/core/jaxws/handler/LogicalMessageImpl.java
Log:
[JBPAPP-1204] ClassCastException: org.jboss.ws.core.soap.TextImpl in LogicalMessageImpl.getPayload.
Modified: stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/ant-import-tests/build-jars-jaxws.xml
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/ant-import-tests/build-jars-jaxws.xml 2008-09-23 18:51:51 UTC (rev 8212)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/ant-import-tests/build-jars-jaxws.xml 2008-09-23 18:53:37 UTC (rev 8213)
@@ -447,6 +447,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-jbws1809 -->
<jar destfile="${tests.output.dir}/libs/jaxws-jbws1809.jar">
Modified: stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/main/java/org/jboss/ws/core/jaxws/handler/LogicalMessageImpl.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/main/java/org/jboss/ws/core/jaxws/handler/LogicalMessageImpl.java 2008-09-23 18:51:51 UTC (rev 8212)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/main/java/org/jboss/ws/core/jaxws/handler/LogicalMessageImpl.java 2008-09-23 18:53:37 UTC (rev 8213)
@@ -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_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2285 (from rev 8123, stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/java/org/jboss/test/ws/jaxws/jbws2285)
Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/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 2008-08-20 09:40:09 UTC (rev 8123)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2285/Endpoint.java 2008-09-23 18:53:37 UTC (rev 8213)
@@ -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(a)jboss.com
- * @since 19th August 2008
- */
-@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_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2285/Endpoint.java (from rev 8123, 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_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2285/Endpoint.java (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2285/Endpoint.java 2008-09-23 18:53:37 UTC (rev 8213)
@@ -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(a)jboss.com
+ * @since 19th August 2008
+ */
+@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_CP03_JBPAPP-1204/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 2008-08-20 09:40:09 UTC (rev 8123)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2285/EndpointImpl.java 2008-09-23 18:53:37 UTC (rev 8213)
@@ -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(a)jboss.com
- * @since 19th August 2008
- */
-@WebService(name = "Endpoint", targetNamespace = "http://ws.jboss.org/jbws2285", endpointInterface = "org.jboss.test.ws.jaxws.jbws2285.Endpoint")
-@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_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2285/EndpointImpl.java (from rev 8123, 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_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2285/EndpointImpl.java (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2285/EndpointImpl.java 2008-09-23 18:53:37 UTC (rev 8213)
@@ -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(a)jboss.com
+ * @since 19th August 2008
+ */
+@WebService(name = "Endpoint", targetNamespace = "http://ws.jboss.org/jbws2285", endpointInterface = "org.jboss.test.ws.jaxws.jbws2285.Endpoint")
+@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_CP03_JBPAPP-1204/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 2008-08-20 09:40:09 UTC (rev 8123)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2285/JBWS2285TestCase.java 2008-09-23 18:53:37 UTC (rev 8213)
@@ -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(a)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_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2285/JBWS2285TestCase.java (from rev 8123, 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_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2285/JBWS2285TestCase.java (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2285/JBWS2285TestCase.java 2008-09-23 18:53:37 UTC (rev 8213)
@@ -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(a)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_CP03_JBPAPP-1204/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 2008-08-20 09:40:09 UTC (rev 8123)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2285/LogicalHandler.java 2008-09-23 18:53:37 UTC (rev 8213)
@@ -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(a)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_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2285/LogicalHandler.java (from rev 8123, 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_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2285/LogicalHandler.java (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/java/org/jboss/test/ws/jaxws/jbws2285/LogicalHandler.java 2008-09-23 18:53:37 UTC (rev 8213)
@@ -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(a)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_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2285 (from rev 8123, stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/resources/jaxws/jbws2285)
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2285/WEB-INF (from rev 8123, stack/native/branches/jbossws-native-2.0.1.SP2_CP01_JBPAPP-1089/src/test/resources/jaxws/jbws2285/WEB-INF)
Deleted: stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/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 2008-08-20 09:40:09 UTC (rev 8123)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2285/WEB-INF/jboss-web.xml 2008-09-23 18:53:37 UTC (rev 8213)
@@ -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_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2285/WEB-INF/jboss-web.xml (from rev 8123, 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_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2285/WEB-INF/jboss-web.xml (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2285/WEB-INF/jboss-web.xml 2008-09-23 18:53:37 UTC (rev 8213)
@@ -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_CP03_JBPAPP-1204/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 2008-08-20 09:40:09 UTC (rev 8123)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2285/WEB-INF/server-handlers.xml 2008-09-23 18:53:37 UTC (rev 8213)
@@ -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_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2285/WEB-INF/server-handlers.xml (from rev 8123, 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_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2285/WEB-INF/server-handlers.xml (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2285/WEB-INF/server-handlers.xml 2008-09-23 18:53:37 UTC (rev 8213)
@@ -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_CP03_JBPAPP-1204/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 2008-08-20 09:40:09 UTC (rev 8123)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2285/WEB-INF/web.xml 2008-09-23 18:53:37 UTC (rev 8213)
@@ -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_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2285/WEB-INF/web.xml (from rev 8123, 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_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2285/WEB-INF/web.xml (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2285/WEB-INF/web.xml 2008-09-23 18:53:37 UTC (rev 8213)
@@ -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_CP03_JBPAPP-1204/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 2008-08-20 09:40:09 UTC (rev 8123)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2285/request-message.xml 2008-09-23 18:53:37 UTC (rev 8213)
@@ -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_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2285/request-message.xml (from rev 8123, 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_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2285/request-message.xml (rev 0)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/test/resources/jaxws/jbws2285/request-message.xml 2008-09-23 18:53:37 UTC (rev 8213)
@@ -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
15 years, 8 months
JBossWS SVN: r8212 - in stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/main/java/org/jboss/ws: metadata/umdm and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2008-09-23 14:51:51 -0400 (Tue, 23 Sep 2008)
New Revision: 8212
Modified:
stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/main/java/org/jboss/ws/core/jaxws/handler/MessageContextJAXWS.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/main/java/org/jboss/ws/metadata/umdm/ServiceMetaData.java
Log:
[JBPAPP-1204] Implement standard message context properties.
Modified: stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/main/java/org/jboss/ws/core/jaxws/handler/MessageContextJAXWS.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/main/java/org/jboss/ws/core/jaxws/handler/MessageContextJAXWS.java 2008-09-23 18:49:32 UTC (rev 8211)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/main/java/org/jboss/ws/core/jaxws/handler/MessageContextJAXWS.java 2008-09-23 18:51:51 UTC (rev 8212)
@@ -23,16 +23,22 @@
// $Id: MessageContextImpl.java 275 2006-05-04 21:36:29Z jason.greene(a)jboss.com $
+import java.io.IOException;
+import java.net.URL;
+
import javax.xml.ws.handler.MessageContext;
import org.jboss.logging.Logger;
+import org.jboss.ws.WSException;
import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.binding.SerializationContext;
import org.jboss.ws.core.jaxws.SerializationContextJAXWS;
import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.ws.metadata.umdm.ServiceMetaData;
import org.jboss.xb.binding.NamespaceRegistry;
+import org.xml.sax.InputSource;
/**
* The interface MessageContext abstracts the message context that is processed by a handler in the handle method.
@@ -105,12 +111,43 @@
MessageContextAssociation.popMessageContext();
SOAPMessageContextJAXWS resContext = new SOAPMessageContextJAXWS(reqContext);
resContext.setSOAPMessage(null);
-
+
// Reverse the direction
resContext.put(MessageContext.MESSAGE_OUTBOUND_PROPERTY, new Boolean(!outbound));
-
+
MessageContextAssociation.pushMessageContext(resContext);
return resContext;
}
+ @Override
+ public void setOperationMetaData(OperationMetaData opMetaData)
+ {
+ super.setOperationMetaData(opMetaData);
+
+ // [JBWS-2031] Implement standard message context properties
+ if (opMetaData != null)
+ {
+ EndpointMetaData epMetaData = opMetaData.getEndpointMetaData();
+ ServiceMetaData serviceMetaData = epMetaData.getServiceMetaData();
+
+ URL wsdlURL = serviceMetaData.getWsdlFileOrLocation();
+ if (wsdlURL != null)
+ {
+ try
+ {
+ InputSource inputSource = new InputSource(wsdlURL.openStream());
+ put(MessageContext.WSDL_DESCRIPTION, inputSource);
+ }
+ catch (IOException ex)
+ {
+ throw new WSException("Cannot open: " + wsdlURL);
+ }
+ }
+
+ put(MessageContext.WSDL_SERVICE, serviceMetaData.getServiceName());
+ put(MessageContext.WSDL_PORT, epMetaData.getPortName());
+ put(MessageContext.WSDL_INTERFACE, epMetaData.getPortTypeName());
+ put(MessageContext.WSDL_OPERATION, opMetaData.getQName());
+ }
+ }
}
Modified: stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/main/java/org/jboss/ws/metadata/umdm/ServiceMetaData.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/main/java/org/jboss/ws/metadata/umdm/ServiceMetaData.java 2008-09-23 18:49:32 UTC (rev 8211)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/src/main/java/org/jboss/ws/metadata/umdm/ServiceMetaData.java 2008-09-23 18:51:51 UTC (rev 8212)
@@ -78,7 +78,7 @@
private String wsdlFile;
private URL mappingLocation;
private String wsdlPublishLocation;
-
+
// The optional service handlers
private List<HandlerMetaDataJAXWS> handlers = new ArrayList<HandlerMetaDataJAXWS>();
@@ -89,16 +89,16 @@
// Arbitrary properties given by <call-property>
private Properties properties;
-
+
// derived cached encoding style
private Use encStyle;
-
+
// The security configuration
private WSSecurityConfiguration securityConfig;
-
+
// The key to the wsdl cache
private String wsdlCacheKey;
-
+
public ServiceMetaData(UnifiedMetaData wsMetaData, QName serviceName)
{
this.wsMetaData = wsMetaData;
@@ -190,7 +190,7 @@
{
handlers.add(handler);
}
-
+
public List<HandlerMetaDataJAXWS> getHandlerMetaData()
{
return Collections.unmodifiableList(handlers);
@@ -279,6 +279,28 @@
*/
public WSDLDefinitions getWsdlDefinitions()
{
+ URL wsdlURL = getWsdlFileOrLocation();
+
+ WSDLDefinitions wsdlDefinitions = null;
+ if (wsdlURL != null)
+ {
+ // The key should not after it is assigned
+ if (wsdlCacheKey == null)
+ wsdlCacheKey = "#" + (wsdlLocation != null ? wsdlLocation : wsdlFile);
+
+ wsdlDefinitions = (WSDLDefinitions)wsMetaData.getWsdlDefinition(wsdlCacheKey);
+ if (wsdlDefinitions == null)
+ {
+ WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
+ wsdlDefinitions = factory.parse(wsdlURL);
+ wsMetaData.addWsdlDefinition(wsdlCacheKey, wsdlDefinitions);
+ }
+ }
+ return wsdlDefinitions;
+ }
+
+ public URL getWsdlFileOrLocation()
+ {
URL wsdlURL = wsdlLocation;
if (wsdlURL == null && wsdlFile != null)
{
@@ -291,7 +313,7 @@
{
// ignore
}
-
+
// Try wsdlFile as child from root
if (wsdlURL == null)
{
@@ -306,23 +328,8 @@
}
}
}
-
- WSDLDefinitions wsdlDefinitions = null;
- if (wsdlURL != null)
- {
- // The key should not after it is assigned
- if (wsdlCacheKey == null)
- wsdlCacheKey = "#" + (wsdlLocation != null ? wsdlLocation : wsdlFile);
-
- wsdlDefinitions = (WSDLDefinitions)wsMetaData.getWsdlDefinition(wsdlCacheKey);
- if (wsdlDefinitions == null)
- {
- WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
- wsdlDefinitions = factory.parse(wsdlURL);
- wsMetaData.addWsdlDefinition(wsdlCacheKey, wsdlDefinitions);
- }
- }
- return wsdlDefinitions;
+
+ return wsdlURL;
}
public TypeMappingImpl getTypeMapping()
15 years, 8 months
JBossWS SVN: r8210 - framework/branches.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2008-09-23 14:45:18 -0400 (Tue, 23 Sep 2008)
New Revision: 8210
Added:
framework/branches/jbossws-framework-2.0.1.GA_CP01_JBPAPP-1204/
Log:
[JBPAPP-1204] Branch for testsuite.
Copied: framework/branches/jbossws-framework-2.0.1.GA_CP01_JBPAPP-1204 (from rev 8209, framework/branches/jbossws-framework-2.0.1.GA_CP01_JBPAPP-1089)
15 years, 8 months
JBossWS SVN: r8209 - stack/native/branches.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2008-09-23 14:40:41 -0400 (Tue, 23 Sep 2008)
New Revision: 8209
Added:
stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204/
Log:
[JBPAPP-1204] Branch for patch.
Copied: stack/native/branches/jbossws-native-2.0.1.SP2_CP03_JBPAPP-1204 (from rev 8208, stack/native/tags/jbossws-native-2.0.1.SP2_CP03)
15 years, 8 months
JBossWS SVN: r8208 - stack/native/branches/dlofthouse.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2008-09-23 14:00:19 -0400 (Tue, 23 Sep 2008)
New Revision: 8208
Removed:
stack/native/branches/dlofthouse/JBWS-2319/
Log:
No longer required.
15 years, 8 months
JBossWS SVN: r8207 - in stack/native/trunk/modules: testsuite/native-tests/scripts and 5 other directories.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2008-09-23 14:00:00 -0400 (Tue, 23 Sep 2008)
New Revision: 8207
Added:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/Endpoint.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/EndpointImpl.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/JBWS2319TestCase.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/SOAPHandler.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/server-handlers.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2319/
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2319/WEB-INF/
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2319/WEB-INF/jboss-web.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2319/WEB-INF/web.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2319/request-message.xml
Removed:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/Endpoint.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/EndpointImpl.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/JBWS2319TestCase.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/SOAPHandler.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/server-handlers.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2319/WEB-INF/
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2319/WEB-INF/jboss-web.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2319/WEB-INF/web.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2319/request-message.xml
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/NodeImpl.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPBodyImpl.java
stack/native/trunk/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml
Log:
[JBWS-2319] ClassCastException in SOAPBody.extractContentAsDocument()
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/NodeImpl.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/NodeImpl.java 2008-09-23 17:16:56 UTC (rev 8206)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/NodeImpl.java 2008-09-23 18:00:00 UTC (rev 8207)
@@ -46,13 +46,13 @@
/**
* A representation of a node (element) in an XML document.
- * This interface extnends the standard DOM Node interface with methods for getting and setting the value of a node,
+ * This interface extends the standard DOM Node interface with methods for getting and setting the value of a node,
* for getting and setting the parent of a node, and for removing a node.
*
* When creating a DOM2 tree the objects maintained by the tree are <code>org.w3c.dom.Node</code> objects
* and not <code>javax.xml.soap.Node</code> objects.
* <p/>
- * This implementation schields the client from the the underlying DOM2 tree, returning <code>javax.xml.soap.Node</code>
+ * This implementation shields the client from the the underlying DOM2 tree, returning <code>javax.xml.soap.Node</code>
* objects.
*
* @author Thomas.Diesler(a)jboss.org
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPBodyImpl.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPBodyImpl.java 2008-09-23 17:16:56 UTC (rev 8206)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPBodyImpl.java 2008-09-23 18:00:00 UTC (rev 8207)
@@ -66,7 +66,7 @@
public SOAPElement addChildElement(SOAPElement child) throws SOAPException
{
log.trace("addChildElement: " + child.getElementName());
-
+
if ((child instanceof SOAPBodyElement) == false)
child = convertToBodyElement(child);
@@ -192,7 +192,7 @@
}
return bodyElement;
}
-
+
public Node appendChild(Node newChild) throws DOMException
{
log.trace("appendChild: " + newChild.getNodeName());
@@ -236,22 +236,33 @@
Iterator childElements = getChildElements();
+ SOAPElementImpl childElement = null;
+
+ while (childElements.hasNext() == true)
+ {
+ Object current = childElements.next();
+ if (current instanceof SOAPElementImpl)
+ childElement = (SOAPElementImpl)current;
+ }
+
// zero child elements?
- if (!childElements.hasNext())
+ if (childElement == null)
throw new SOAPException("Cannot find SOAPBodyElement");
- SOAPElementImpl childElement = (SOAPElementImpl)childElements.next();
-
// more than one child element?
- if (childElements.hasNext())
- throw new SOAPException("Multiple SOAPBodyElement");
+ while (childElements.hasNext() == true)
+ {
+ Object current = childElements.next();
+ if (current instanceof SOAPElementImpl)
+ throw new SOAPException("Multiple SOAPBodyElement");
+ }
if (childElement instanceof SOAPContentElement)
{
// cause expansion to DOM
SOAPContentElement contentElement = (SOAPContentElement)childElement;
// TODO change visibility of SOAPContentElement.expandToDOM() to package?
- contentElement.getPayload();
+ contentElement.hasChildNodes();
}
// child SOAPElement is removed as part of this process
Modified: stack/native/trunk/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml 2008-09-23 17:16:56 UTC (rev 8206)
+++ stack/native/trunk/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml 2008-09-23 18:00:00 UTC (rev 8207)
@@ -372,6 +372,18 @@
<include name="jboss-web.xml"/>
</webinf>
</war>
+
+ <!-- jaxws-jbws2319 -->
+ <war warfile="${tests.output.dir}/test-libs/jaxws-jbws2319.war" webxml="${tests.output.dir}/test-resources/jaxws/jbws2319/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/jbws2319/*.class"/>
+ <exclude name="org/jboss/test/ws/jaxws/jbws2319/JBWS2285TestCase.class"/>
+ <include name="org/jboss/test/ws/jaxws/jbws2319/server-handlers.xml"/>
+ </classes>
+ <webinf dir="${tests.output.dir}/test-resources/jaxws/jbws2319/WEB-INF">
+ <include name="jboss-web.xml"/>
+ </webinf>
+ </war>
<!-- jaxws-webserviceref -->
<war warfile="${tests.output.dir}/test-libs/jaxws-webserviceref.war" webxml="${tests.output.dir}/test-resources/jaxws/webserviceref/WEB-INF/web.xml">
Copied: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319 (from rev 8205, stack/native/branches/dlofthouse/JBWS-2319/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319)
Deleted: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/Endpoint.java
===================================================================
--- stack/native/branches/dlofthouse/JBWS-2319/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/Endpoint.java 2008-09-23 16:55:10 UTC (rev 8205)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/Endpoint.java 2008-09-23 18:00:00 UTC (rev 8207)
@@ -1,38 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, 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.jbws2319;
-
-import javax.jws.WebService;
-
-/**
- * Test Endpoint.
- *
- * @author darran.lofthouse(a)jboss.com
- * @since 23rd September 2008
- */
-@WebService(name = "Endpoint", targetNamespace = "http://ws.jboss.org/jbws2319")
-public interface Endpoint
-{
-
- public String echo(final String message);
-
-}
Copied: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/Endpoint.java (from rev 8205, stack/native/branches/dlofthouse/JBWS-2319/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/Endpoint.java)
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/Endpoint.java (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/Endpoint.java 2008-09-23 18:00:00 UTC (rev 8207)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, 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.jbws2319;
+
+import javax.jws.WebService;
+
+/**
+ * Test Endpoint.
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 23rd September 2008
+ */
+@WebService(name = "Endpoint", targetNamespace = "http://ws.jboss.org/jbws2319")
+public interface Endpoint
+{
+
+ public String echo(final String message);
+
+}
Deleted: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/EndpointImpl.java
===================================================================
--- stack/native/branches/dlofthouse/JBWS-2319/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/EndpointImpl.java 2008-09-23 16:55:10 UTC (rev 8205)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/EndpointImpl.java 2008-09-23 18:00:00 UTC (rev 8207)
@@ -1,47 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, 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.jbws2319;
-
-import javax.jws.HandlerChain;
-import javax.jws.WebService;
-
-import org.jboss.logging.Logger;
-
-/**
- * Test Endpoint implementation.
- *
- * @author darran.lofthouse(a)jboss.com
- * @since 23rd September 2008
- */
-@WebService(name = "Endpoint", targetNamespace = "http://ws.jboss.org/jbws2319", endpointInterface = "org.jboss.test.ws.jaxws.jbws2319.Endpoint")
-@HandlerChain(file = "server-handlers.xml")
-public class EndpointImpl implements Endpoint
-{
- private static final Logger log = Logger.getLogger(EndpointImpl.class);
-
- public String echo(final String message)
- {
- log.info("Value to echo '" + message + "'");
- return message;
- }
-
-}
Copied: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/EndpointImpl.java (from rev 8205, stack/native/branches/dlofthouse/JBWS-2319/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/EndpointImpl.java)
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/EndpointImpl.java (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/EndpointImpl.java 2008-09-23 18:00:00 UTC (rev 8207)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, 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.jbws2319;
+
+import javax.jws.HandlerChain;
+import javax.jws.WebService;
+
+import org.jboss.logging.Logger;
+
+/**
+ * Test Endpoint implementation.
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 23rd September 2008
+ */
+@WebService(name = "Endpoint", targetNamespace = "http://ws.jboss.org/jbws2319", endpointInterface = "org.jboss.test.ws.jaxws.jbws2319.Endpoint")
+@HandlerChain(file = "server-handlers.xml")
+public class EndpointImpl implements Endpoint
+{
+ private static final Logger log = Logger.getLogger(EndpointImpl.class);
+
+ public String echo(final String message)
+ {
+ log.info("Value to echo '" + message + "'");
+ return message;
+ }
+
+}
Deleted: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/JBWS2319TestCase.java
===================================================================
--- stack/native/branches/dlofthouse/JBWS-2319/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/JBWS2319TestCase.java 2008-09-23 16:55:10 UTC (rev 8205)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/JBWS2319TestCase.java 2008-09-23 18:00:00 UTC (rev 8207)
@@ -1,121 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, 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.jbws2319;
-
-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-2319] ClassCastException: org.jboss.ws.core.soap.TextImpl
- * in SOAPBody.extractContentAsDocument();
- *
- * @author darran.lofthouse(a)jboss.com
- * @since 23rd September 2008
- * @see https://jira.jboss.org/jira/browse/JBWS-2319
- */
-public class JBWS2319TestCase extends JBossWSTest
-{
-
- public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() + ":8080/jaxws-jbws2319/";
-
- private static Endpoint port;
-
- public static Test suite() throws Exception
- {
- return new JBossWSTestSetup(JBWS2319TestCase.class, "jaxws-jbws2319.war");
- }
-
- public void setUp() throws Exception
- {
- super.setUp();
- URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
- QName serviceName = new QName("http://ws.jboss.org/jbws2319", "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/jbws2319", "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 = getResourceFile("jaxws/jbws2319/request-message.xml").toURL();
- MessageFactory msgFactory = MessageFactory.newInstance();
-
- SOAPMessage reqMsg = msgFactory.createMessage(null, reqMessage.openStream());
- return reqMsg;
- }
-
-}
Copied: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/JBWS2319TestCase.java (from rev 8205, stack/native/branches/dlofthouse/JBWS-2319/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/JBWS2319TestCase.java)
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/JBWS2319TestCase.java (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/JBWS2319TestCase.java 2008-09-23 18:00:00 UTC (rev 8207)
@@ -0,0 +1,121 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, 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.jbws2319;
+
+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-2319] ClassCastException: org.jboss.ws.core.soap.TextImpl
+ * in SOAPBody.extractContentAsDocument();
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 23rd September 2008
+ * @see https://jira.jboss.org/jira/browse/JBWS-2319
+ */
+public class JBWS2319TestCase extends JBossWSTest
+{
+
+ public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() + ":8080/jaxws-jbws2319/";
+
+ private static Endpoint port;
+
+ public static Test suite() throws Exception
+ {
+ return new JBossWSTestSetup(JBWS2319TestCase.class, "jaxws-jbws2319.war");
+ }
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
+ QName serviceName = new QName("http://ws.jboss.org/jbws2319", "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/jbws2319", "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 = getResourceFile("jaxws/jbws2319/request-message.xml").toURL();
+ MessageFactory msgFactory = MessageFactory.newInstance();
+
+ SOAPMessage reqMsg = msgFactory.createMessage(null, reqMessage.openStream());
+ return reqMsg;
+ }
+
+}
Deleted: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/SOAPHandler.java
===================================================================
--- stack/native/branches/dlofthouse/JBWS-2319/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/SOAPHandler.java 2008-09-23 16:55:10 UTC (rev 8205)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/SOAPHandler.java 2008-09-23 18:00:00 UTC (rev 8207)
@@ -1,99 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, 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.jbws2319;
-
-import javax.xml.soap.SOAPBody;
-import javax.xml.soap.SOAPElementFactory;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.ws.handler.LogicalMessageContext;
-import javax.xml.ws.handler.MessageContext;
-import javax.xml.ws.handler.soap.SOAPMessageContext;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.wsf.common.DOMWriter;
-import org.jboss.wsf.common.handler.GenericSOAPHandler;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * Logical handler implementation.
- *
- * @author darran.lofthouse(a)jboss.com
- * @since 23rd September 2008
- */
-public class SOAPHandler extends GenericSOAPHandler<LogicalMessageContext>
-{
-
- private static final Logger log = Logger.getLogger(SOAPHandler.class);
-
- @Override
- protected boolean handleInbound(final MessageContext msgContext)
- {
- log.info("handleInbound()");
-
- try
- {
- SOAPMessageContext smc = (SOAPMessageContext)msgContext;
- SOAPMessage message = smc.getMessage();
-
- SOAPBody body = message.getSOAPBody();
- Document document = body.extractContentAsDocument();
- Node node = document;
-
- log.info(DOMWriter.printNode(node, false));
-
- NodeList nodes = node.getChildNodes();
- for (int i = 0; i < nodes.getLength(); i++)
- {
- Node current = nodes.item(i);
-
- NodeList childNodes = current.getChildNodes();
- for (int j = 0; j < childNodes.getLength(); j++)
- {
- Node currentChildNode = childNodes.item(j);
- if ("arg0".equals(currentChildNode.getLocalName()))
- {
- log.info("Replacing " + currentChildNode.getTextContent() + " with XXX");
- currentChildNode.setTextContent("XXX");
- }
- }
- }
-
- log.info(DOMWriter.printNode(node, false));
-
- // Add document back as removed by call to 'extractContentAsDocument()'
- body.addDocument(document);
- message.saveChanges();
- }
- catch (SOAPException e)
- {
- throw new WSException("Error in Handler", e);
- }
-
- log.info("Finished");
- return true;
- }
-
-}
Copied: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/SOAPHandler.java (from rev 8205, stack/native/branches/dlofthouse/JBWS-2319/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/SOAPHandler.java)
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/SOAPHandler.java (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/SOAPHandler.java 2008-09-23 18:00:00 UTC (rev 8207)
@@ -0,0 +1,99 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, 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.jbws2319;
+
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPElementFactory;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.handler.LogicalMessageContext;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.WSException;
+import org.jboss.wsf.common.DOMWriter;
+import org.jboss.wsf.common.handler.GenericSOAPHandler;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * Logical handler implementation.
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 23rd September 2008
+ */
+public class SOAPHandler extends GenericSOAPHandler<LogicalMessageContext>
+{
+
+ private static final Logger log = Logger.getLogger(SOAPHandler.class);
+
+ @Override
+ protected boolean handleInbound(final MessageContext msgContext)
+ {
+ log.info("handleInbound()");
+
+ try
+ {
+ SOAPMessageContext smc = (SOAPMessageContext)msgContext;
+ SOAPMessage message = smc.getMessage();
+
+ SOAPBody body = message.getSOAPBody();
+ Document document = body.extractContentAsDocument();
+ Node node = document;
+
+ log.info(DOMWriter.printNode(node, false));
+
+ NodeList nodes = node.getChildNodes();
+ for (int i = 0; i < nodes.getLength(); i++)
+ {
+ Node current = nodes.item(i);
+
+ NodeList childNodes = current.getChildNodes();
+ for (int j = 0; j < childNodes.getLength(); j++)
+ {
+ Node currentChildNode = childNodes.item(j);
+ if ("arg0".equals(currentChildNode.getLocalName()))
+ {
+ log.info("Replacing " + currentChildNode.getTextContent() + " with XXX");
+ currentChildNode.setTextContent("XXX");
+ }
+ }
+ }
+
+ log.info(DOMWriter.printNode(node, false));
+
+ // Add document back as removed by call to 'extractContentAsDocument()'
+ body.addDocument(document);
+ message.saveChanges();
+ }
+ catch (SOAPException e)
+ {
+ throw new WSException("Error in Handler", e);
+ }
+
+ log.info("Finished");
+ return true;
+ }
+
+}
Deleted: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/server-handlers.xml
===================================================================
--- stack/native/branches/dlofthouse/JBWS-2319/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/server-handlers.xml 2008-09-23 16:55:10 UTC (rev 8205)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/server-handlers.xml 2008-09-23 18:00:00 UTC (rev 8207)
@@ -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> SOAPServerHandler </handler-name>
- <handler-class> org.jboss.test.ws.jaxws.jbws2319.SOAPHandler </handler-class>
- </handler>
- </handler-chain>
-
-</handler-chains>
\ No newline at end of file
Copied: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/server-handlers.xml (from rev 8205, stack/native/branches/dlofthouse/JBWS-2319/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/server-handlers.xml)
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/server-handlers.xml (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2319/server-handlers.xml 2008-09-23 18:00:00 UTC (rev 8207)
@@ -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> SOAPServerHandler </handler-name>
+ <handler-class> org.jboss.test.ws.jaxws.jbws2319.SOAPHandler </handler-class>
+ </handler>
+ </handler-chain>
+
+</handler-chains>
\ No newline at end of file
Copied: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2319 (from rev 8205, stack/native/branches/dlofthouse/JBWS-2319/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2319)
Copied: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2319/WEB-INF (from rev 8205, stack/native/branches/dlofthouse/JBWS-2319/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2319/WEB-INF)
Deleted: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2319/WEB-INF/jboss-web.xml
===================================================================
--- stack/native/branches/dlofthouse/JBWS-2319/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2319/WEB-INF/jboss-web.xml 2008-09-23 16:55:10 UTC (rev 8205)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2319/WEB-INF/jboss-web.xml 2008-09-23 18:00:00 UTC (rev 8207)
@@ -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-jbws2319</context-root>
-</jboss-web>
\ No newline at end of file
Copied: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2319/WEB-INF/jboss-web.xml (from rev 8205, stack/native/branches/dlofthouse/JBWS-2319/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2319/WEB-INF/jboss-web.xml)
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2319/WEB-INF/jboss-web.xml (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2319/WEB-INF/jboss-web.xml 2008-09-23 18:00:00 UTC (rev 8207)
@@ -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-jbws2319</context-root>
+</jboss-web>
\ No newline at end of file
Deleted: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2319/WEB-INF/web.xml
===================================================================
--- stack/native/branches/dlofthouse/JBWS-2319/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2319/WEB-INF/web.xml 2008-09-23 16:55:10 UTC (rev 8205)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2319/WEB-INF/web.xml 2008-09-23 18:00:00 UTC (rev 8207)
@@ -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.jbws2319.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/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2319/WEB-INF/web.xml (from rev 8205, stack/native/branches/dlofthouse/JBWS-2319/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2319/WEB-INF/web.xml)
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2319/WEB-INF/web.xml (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2319/WEB-INF/web.xml 2008-09-23 18:00:00 UTC (rev 8207)
@@ -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.jbws2319.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/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2319/request-message.xml
===================================================================
--- stack/native/branches/dlofthouse/JBWS-2319/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2319/request-message.xml 2008-09-23 16:55:10 UTC (rev 8205)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2319/request-message.xml 2008-09-23 18:00:00 UTC (rev 8207)
@@ -1,8 +0,0 @@
-<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:jbw="http://ws.jboss.org/jbws2319">
- <soapenv:Header/>
- <soapenv:Body>
- <jbw:echo>
- <arg0>SSS</arg0>
- </jbw:echo>
- </soapenv:Body>
-</soapenv:Envelope>
\ No newline at end of file
Copied: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2319/request-message.xml (from rev 8205, stack/native/branches/dlofthouse/JBWS-2319/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2319/request-message.xml)
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2319/request-message.xml (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2319/request-message.xml 2008-09-23 18:00:00 UTC (rev 8207)
@@ -0,0 +1,8 @@
+<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:jbw="http://ws.jboss.org/jbws2319">
+ <soapenv:Header/>
+ <soapenv:Body>
+ <jbw:echo>
+ <arg0>SSS</arg0>
+ </jbw:echo>
+ </soapenv:Body>
+</soapenv:Envelope>
\ No newline at end of file
15 years, 8 months
JBossWS SVN: r8206 - in stack/native/trunk/modules: testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1988 and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2008-09-23 13:16:56 -0400 (Tue, 23 Sep 2008)
New Revision: 8206
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/Constants.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1988/MessageTestCase.java
Log:
[JBWS-2309] PasswordType element uses wss-wssecurity-secext NS instead of wss-username-token-profile
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/Constants.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/Constants.java 2008-09-23 16:55:10 UTC (rev 8205)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/security/Constants.java 2008-09-23 17:16:56 UTC (rev 8206)
@@ -56,9 +56,9 @@
public static final String BASE64_ENCODING_TYPE = WSS_SOAP_NS + "#Base64Binary";
- public static final String PASSWORD_TEXT_TYPE = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext...";
+ public static final String PASSWORD_TEXT_TYPE = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-pr...";
- public static final String PASSWORD_DIGEST_TYPE = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext...";
+ public static final String PASSWORD_DIGEST_TYPE = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-pr...";
public static final String WSSE_HEADER = WSSE_PREFIX + ":Security";
Modified: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1988/MessageTestCase.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1988/MessageTestCase.java 2008-09-23 16:55:10 UTC (rev 8205)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1988/MessageTestCase.java 2008-09-23 17:16:56 UTC (rev 8206)
@@ -110,7 +110,7 @@
"xmlns:wsu='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit...'>" +
"<wsse:UsernameToken wsu:Id='token-1-1205341951321-19004769'>" +
"<wsse:Username>kermit</wsse:Username>" +
- "<wsse:Password Type='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext...'>IEeuDaP/NTozwiyJHzTgBoCCDjg=</wsse:Password>" +
+ "<wsse:Password Type='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-pr...'>IEeuDaP/NTozwiyJHzTgBoCCDjg=</wsse:Password>" +
"<wsse:Nonce EncodingType='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-secu...'>gHGIdDEWjX1Ay/LiVd3qJ1ua8VbjXis8CJwNDQh1ySA=</wsse:Nonce>" +
"<wsse:Created>CREATED</wsse:Created>" +
"</wsse:UsernameToken>" +
@@ -146,7 +146,7 @@
"xmlns:wsu='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit...'>" +
"<wsse:UsernameToken wsu:Id='token-1-1205341951321-19004769'>" +
"<wsse:Username>kermit</wsse:Username>" +
- "<wsse:Password Type='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext...'>IEeuDaP/NTozwiyJHzTgBoCCDjg=</wsse:Password>" +
+ "<wsse:Password Type='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-pr...'>IEeuDaP/NTozwiyJHzTgBoCCDjg=</wsse:Password>" +
"<wsse:Nonce>gHGIdDEWjX1Ay/LiVd3qJ1ua8VbjXis8CJwNDQh1ySA=</wsse:Nonce>" +
"<wsse:Created>CREATED</wsse:Created>" +
"</wsse:UsernameToken>" +
@@ -244,6 +244,6 @@
Element passwordEl = (Element)DOMUtils.getChildElements(usernameTokenEl, new QName(Constants.WSSE_NS, "Password")).next();
assertNotNull(passwordEl);
assertNotNull(DOMUtils.getTextContent(passwordEl));
- assertEquals("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext...", passwordEl.getAttribute("Type"));
+ assertEquals("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-pr...", passwordEl.getAttribute("Type"));
}
}
15 years, 8 months