JBossWS SVN: r10327 - stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/soap.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-07-16 09:14:53 -0400 (Thu, 16 Jul 2009)
New Revision: 10327
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/soap/SOAPAddressingPropertiesImpl.java
Log:
[JBWS-2632] Preventing NPE
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/soap/SOAPAddressingPropertiesImpl.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/soap/SOAPAddressingPropertiesImpl.java 2009-07-16 12:50:54 UTC (rev 10326)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/soap/SOAPAddressingPropertiesImpl.java 2009-07-16 13:14:53 UTC (rev 10327)
@@ -44,6 +44,7 @@
import javax.xml.ws.addressing.soap.SOAPAddressingBuilder;
import javax.xml.ws.addressing.soap.SOAPAddressingProperties;
+import org.jboss.logging.Logger;
import org.jboss.ws.core.soap.NameImpl;
import org.jboss.ws.core.soap.SOAPFactoryImpl;
import org.jboss.ws.extensions.addressing.AddressingConstantsImpl;
@@ -67,6 +68,8 @@
*/
public class SOAPAddressingPropertiesImpl extends AddressingPropertiesImpl implements SOAPAddressingProperties
{
+ private static Logger log = Logger.getLogger(SOAPAddressingBuilderImpl.class);
+
private static AddressingConstants ADDR = new AddressingConstantsImpl();
private NamespaceRegistry nsRegistry = new NamespaceRegistry();
@@ -222,6 +225,12 @@
SOAPFactoryImpl factory = (SOAPFactoryImpl)SOAPFactory.newInstance();
SOAPHeader soapHeader = message.getSOAPHeader();
+ if (soapHeader == null)
+ {
+ log.warn("No SOAP headers found!");
+ return;
+ }
+
// Add the xmlns:wsa declaration
soapHeader.addNamespaceDeclaration(ADDR.getNamespacePrefix(), ADDR.getNamespaceURI());
14 years, 9 months
JBossWS SVN: r10326 - stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-07-16 08:50:54 -0400 (Thu, 16 Jul 2009)
New Revision: 10326
Added:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/CommentImpl.java
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/NodeImpl.java
Log:
[JBWS-2526] Comitting Gerald's fix
Added: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/CommentImpl.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/CommentImpl.java (rev 0)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/CommentImpl.java 2009-07-16 12:50:54 UTC (rev 10326)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.core.soap;
+
+/**
+ * A representation of a node whose value is text. A Text
+ * object may represent text that is content or text that is a comment.
+ *
+ */
+public class CommentImpl extends TextImpl implements org.w3c.dom.Comment
+{
+
+ public CommentImpl(org.w3c.dom.Node node)
+ {
+ super(node);
+ }
+
+}
Property changes on: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/CommentImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
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 2009-07-16 12:50:05 UTC (rev 10325)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/NodeImpl.java 2009-07-16 12:50:54 UTC (rev 10326)
@@ -561,7 +561,7 @@
}
else if (node instanceof org.w3c.dom.Comment)
{
- retNode = new TextImpl(node);
+ retNode = new CommentImpl(node);
}
else if (node instanceof org.w3c.dom.Element)
{
14 years, 9 months
JBossWS SVN: r10325 - in stack/native/trunk/modules/testsuite/native-tests: src/test/java/org/jboss/test/ws/jaxws and 6 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-07-16 08:50:05 -0400 (Thu, 16 Jul 2009)
New Revision: 10325
Added:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2526/
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2526/Endpoint.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2526/JBWS2526TestCase.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2526/LogicalHandler.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2526/Request.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2526/Response.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2526/server-handlers.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2526/
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2526/WEB-INF/
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2526/WEB-INF/web.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2526/WEB-INF/wsdl/
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2526/WEB-INF/wsdl/jbws2526.wsdl
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2526/WEB-INF/wsdl/jbws2526.xsd
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2526/request-message-with-comment.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2526/request-message-without-comment.xml
Modified:
stack/native/trunk/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2682/JBWS2682TestCase.java
Log:
[JBWS-2526] Adding testcase provided by Garald Turner
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 2009-07-16 12:46:37 UTC (rev 10324)
+++ stack/native/trunk/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml 2009-07-16 12:50:05 UTC (rev 10325)
@@ -522,6 +522,18 @@
</classes>
</war>
+ <!-- jaxws-jbws2526 -->
+ <war warfile="${tests.output.dir}/test-libs/jaxws-jbws2526.war" webxml="${tests.output.dir}/test-resources/jaxws/jbws2526/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/jbws2526/*.class"/>
+ <exclude name="org/jboss/test/ws/jaxws/jbws2526/JBWS2526TestCase.class"/>
+ <include name="org/jboss/test/ws/jaxws/jbws2526/server-handlers.xml"/>
+ </classes>
+ <webinf dir="${tests.output.dir}/test-resources/jaxws/jbws2526/WEB-INF">
+ <include name="wsdl/**"/>
+ </webinf>
+ </war>
+
<!-- jaxws-jbws2565 -->
<jar jarfile="${tests.output.dir}/test-libs/jaxws-jbws2565.jar">
<fileset dir="${tests.output.dir}/test-classes">
Added: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2526/Endpoint.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2526/Endpoint.java (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2526/Endpoint.java 2009-07-16 12:50:05 UTC (rev 10325)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jbws2526;
+
+import javax.jws.HandlerChain;
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+/**
+ * Test endpoint.
+ *
+ */
+@WebService(name = "Port", serviceName = "Service", portName = "Port", targetNamespace = "urn:JBWS-2526-Service", wsdlLocation = "WEB-INF/wsdl/jbws2526.wsdl")
+@HandlerChain(file = "server-handlers.xml")
+@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
+public class Endpoint
+{
+
+ @WebMethod
+ @WebResult(name = "Response", targetNamespace = "urn:JBWS-2526-Schema", partName = "response")
+ public Response evaluate(@WebParam(name = "Request", targetNamespace = "urn:JBWS-2526-Schema", partName = "request") Request request)
+ {
+ Response response = new Response();
+ response.setValue(request.getValue1() * request.getValue2());
+ return response;
+ }
+
+}
\ No newline at end of file
Property changes on: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2526/Endpoint.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2526/JBWS2526TestCase.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2526/JBWS2526TestCase.java (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2526/JBWS2526TestCase.java 2009-07-16 12:50:05 UTC (rev 10325)
@@ -0,0 +1,78 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jbws2526;
+
+import java.net.URL;
+
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPConnection;
+import javax.xml.soap.SOAPConnectionFactory;
+import javax.xml.soap.SOAPMessage;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * [JBWS-2526] org.jboss.ws.core.soap.TextImpl does not implement
+ * org.w3c.dom.Comment.
+ *
+ * @author <a href="mailto:gturner@unzane.com">Gerald Turner</a>
+ */
+public class JBWS2526TestCase extends JBossWSTest
+{
+
+ public static Test suite() throws Exception
+ {
+ return new JBossWSTestSetup(JBWS2526TestCase.class, "jaxws-jbws2526.war");
+ }
+
+ public void testWithoutComment() throws Exception
+ {
+ test("jaxws/jbws2526/request-message-without-comment.xml");
+ }
+
+ public void testWithComment() throws Exception
+ {
+ test("jaxws/jbws2526/request-message-with-comment.xml");
+ }
+
+ private void test(String requestFile) throws Exception
+ {
+ URL requestURL = getResourceFile(requestFile).toURL();
+ MessageFactory messageFactory = MessageFactory.newInstance();
+ SOAPMessage requestMessage = messageFactory.createMessage(null, requestURL.openStream());
+ URL endpointURL = new URL("http://" + getServerHost() + ":8080/jaxws-jbws2526/");
+ SOAPConnection connection = SOAPConnectionFactory.newInstance().createConnection();
+ SOAPMessage responseMessage = connection.call(requestMessage, endpointURL);
+ SOAPBody responseBody = responseMessage.getSOAPPart().getEnvelope().getBody();
+
+ assertFalse(responseBody.hasFault());
+
+ // Assume request-message-*.xml has Value1 = 9
+ // LogicalHandler will replace Value2 = 2
+ assertEquals("18", responseBody.getFirstChild().getFirstChild().getFirstChild().getNodeValue());
+ }
+
+}
Property changes on: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2526/JBWS2526TestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2526/LogicalHandler.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2526/LogicalHandler.java (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2526/LogicalHandler.java 2009-07-16 12:50:05 UTC (rev 10325)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jbws2526;
+
+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.jboss.ws.WSException;
+import org.jboss.wsf.common.handler.GenericLogicalHandler;
+import org.w3c.dom.Comment;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * Logical handler implementation.
+ *
+ */
+public class LogicalHandler extends GenericLogicalHandler
+{
+
+ @Override
+ protected boolean handleInbound(MessageContext messageContext)
+ {
+ LogicalMessageContext context = (LogicalMessageContext)messageContext;
+ LogicalMessage message = context.getMessage();
+ Object payload = message.getPayload();
+ if (!(payload instanceof DOMSource))
+ throw new WSException("Test requires DOMSource payload");
+
+ Node node = ((DOMSource)payload).getNode();
+ NodeList nodes = node.getChildNodes();
+ for (int i = 0; i < nodes.getLength(); i++)
+ {
+ Node current = nodes.item(i);
+ if (current.getNodeType() == Node.COMMENT_NODE)
+ {
+ if (!(current instanceof Comment))
+ throw new WSException("Found comment node that does not implement org.w3c.dom.Comment");
+ }
+ else if ("Value2".equals(current.getLocalName()))
+ {
+ Node child = current.getFirstChild();
+ child.setNodeValue("2");
+ }
+ }
+
+ return true;
+ }
+
+}
Property changes on: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2526/LogicalHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2526/Request.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2526/Request.java (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2526/Request.java 2009-07-16 12:50:05 UTC (rev 10325)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jbws2526;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ * Test request parameter.
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlRootElement(name = "Request", namespace = "urn:JBWS-2526-Schema")
+@XmlType(name = "", propOrder = { "value1", "value2" })
+public class Request
+{
+
+ @XmlElement(name = "Value1", required = true, namespace = "urn:JBWS-2526-Schema")
+ protected int value1;
+
+ @XmlElement(name = "Value2", required = true, namespace = "urn:JBWS-2526-Schema")
+ protected int value2;
+
+ public int getValue1()
+ {
+ return value1;
+ }
+
+ public void setValue1(int value1)
+ {
+ this.value1 = value1;
+ }
+
+ public int getValue2()
+ {
+ return value2;
+ }
+
+ public void setValue2(int value2)
+ {
+ this.value2 = value2;
+ }
+
+}
Property changes on: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2526/Request.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2526/Response.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2526/Response.java (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2526/Response.java 2009-07-16 12:50:05 UTC (rev 10325)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jbws2526;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ * Test response parameter.
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlRootElement(name = "Response", namespace = "urn:JBWS-2526-Schema")
+public class Response
+{
+
+ @XmlElement(name = "Value", required = true, namespace = "urn:JBWS-2526-Schema")
+ protected int value;
+
+ public int getValue()
+ {
+ return value;
+ }
+
+ public void setValue(int value)
+ {
+ this.value = value;
+ }
+
+}
Property changes on: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2526/Response.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2526/server-handlers.xml
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2526/server-handlers.xml (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2526/server-handlers.xml 2009-07-16 12:50:05 UTC (rev 10325)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<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.jbws2526.LogicalHandler</handler-class>
+ </handler>
+ </handler-chain>
+</handler-chains>
\ No newline at end of file
Property changes on: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2526/server-handlers.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2682/JBWS2682TestCase.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2682/JBWS2682TestCase.java 2009-07-16 12:46:37 UTC (rev 10324)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2682/JBWS2682TestCase.java 2009-07-16 12:50:05 UTC (rev 10325)
@@ -57,7 +57,7 @@
"<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:jbw='http://ws.jboss.org/jbws2682'>" +
" <soapenv:Header/>" + " <soapenv:Body>" +
" <jbw:echo>" +
- " <arg0>1-1</arg0>" +
+ " <arg0>1-1ciao</arg0>" +
" </jbw:echo>" +
" </soapenv:Body>" +
"</soapenv:Envelope>";
Added: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2526/WEB-INF/web.xml
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2526/WEB-INF/web.xml (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2526/WEB-INF/web.xml 2009-07-16 12:50:05 UTC (rev 10325)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<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.jbws2526.Endpoint</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>Endpoint</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+</web-app>
\ No newline at end of file
Property changes on: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2526/WEB-INF/web.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2526/WEB-INF/wsdl/jbws2526.wsdl
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2526/WEB-INF/wsdl/jbws2526.wsdl (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2526/WEB-INF/wsdl/jbws2526.wsdl 2009-07-16 12:50:05 UTC (rev 10325)
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="JBWS-2526"
+ targetNamespace="urn:JBWS-2526-Service"
+ xmlns:service="urn:JBWS-2526-Service"
+ xmlns:schema="urn:JBWS-2526-Schema"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ <xs:schema>
+ <xs:import namespace="urn:JBWS-2526-Schema"
+ schemaLocation="jbws2526.xsd"/>
+ </xs:schema>
+ </types>
+
+ <message name="Request">
+ <part name="request" element="schema:Request"/>
+ </message>
+ <message name="Response">
+ <part name="response" element="schema:Response"/>
+ </message>
+
+ <portType name="Port">
+ <operation name="evaluate">
+ <input message="service:Request"/>
+ <output message="service:Response"/>
+ </operation>
+ </portType>
+
+ <binding name="Binding" type="service:Port">
+ <soap:binding style="document"
+ transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="evaluate">
+ <soap:operation/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ </binding>
+
+ <service name="Service">
+ <port binding="service:Binding" name="Port">
+ <soap:address location="http://localhost:8080/jaxws-jbws2526"/>
+ </port>
+ </service>
+</definitions>
\ No newline at end of file
Property changes on: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2526/WEB-INF/wsdl/jbws2526.wsdl
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2526/WEB-INF/wsdl/jbws2526.xsd
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2526/WEB-INF/wsdl/jbws2526.xsd (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2526/WEB-INF/wsdl/jbws2526.xsd 2009-07-16 12:50:05 UTC (rev 10325)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<xs:schema xmlns="urn:JBWS-2526-Schema"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="urn:JBWS-2526-Schema"
+ elementFormDefault="qualified"
+ attributeFormDefault="unqualified">
+ <xs:element name="Request">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="Value1" type="xs:int"/>
+ <xs:element name="Value2" type="xs:int"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="Response">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="Result" type="xs:int"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+</xs:schema>
\ No newline at end of file
Property changes on: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2526/WEB-INF/wsdl/jbws2526.xsd
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2526/request-message-with-comment.xml
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2526/request-message-with-comment.xml (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2526/request-message-with-comment.xml 2009-07-16 12:50:05 UTC (rev 10325)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
+ soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns="urn:JBWS-2526-Schema">
+ <soap:Body>
+ <Request>
+ <!-- This is a comment node which may trigger a ClassCastException -->
+ <Value1>9</Value1>
+ <Value2>9</Value2>
+ </Request>
+ </soap:Body>
+</soap:Envelope>
\ No newline at end of file
Property changes on: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2526/request-message-with-comment.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2526/request-message-without-comment.xml
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2526/request-message-without-comment.xml (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2526/request-message-without-comment.xml 2009-07-16 12:50:05 UTC (rev 10325)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
+ soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns="urn:JBWS-2526-Schema">
+ <soap:Body>
+ <Request>
+ <Value1>9</Value1>
+ <Value2>9</Value2>
+ </Request>
+ </soap:Body>
+</soap:Envelope>
\ No newline at end of file
Property changes on: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2526/request-message-without-comment.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
14 years, 9 months
JBossWS SVN: r10324 - stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-07-16 08:46:37 -0400 (Thu, 16 Jul 2009)
New Revision: 10324
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializer.java
Log:
Workaround for JBWS-2686 (Parsing errors fail to terminate unmarshalling) while waiting for Sun's bug to be fixed
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializer.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializer.java 2009-07-15 13:24:40 UTC (rev 10323)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializer.java 2009-07-16 12:46:37 UTC (rev 10324)
@@ -24,6 +24,8 @@
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.Unmarshaller;
+import javax.xml.bind.ValidationEvent;
+import javax.xml.bind.ValidationEventHandler;
import javax.xml.namespace.QName;
import javax.xml.transform.Source;
import javax.xml.ws.WebServiceException;
@@ -67,7 +69,17 @@
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
unmarshaller.setAttachmentUnmarshaller( new AttachmentUnmarshallerImpl());
+
+ //workaround for https://jira.jboss.org/jira/browse/JBWS-2686 while waiting for Sun's bug to be fixed
+ unmarshaller.setEventHandler(new ValidationEventHandler() {
+ public boolean handleEvent(final ValidationEvent event)
+ {
+ int severity = event.getSeverity();
+ return (severity != ValidationEvent.FATAL_ERROR && severity != ValidationEvent.ERROR);
+ }
+ });
+
JAXBElement jbe = unmarshaller.unmarshal(xmlFragment, javaType);
value = jbe.getValue();
14 years, 9 months
JBossWS SVN: r10323 - in stack/native/trunk/modules/core/src/main/java/org/jboss/ws: extensions/wsrm/transport/backchannel and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-07-15 09:24:40 -0400 (Wed, 15 Jul 2009)
New Revision: 10323
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/client/NettyClient.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/client/WSResponseHandler.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMBackPortsInvocationHandler.java
Log:
[JBWS-2554] Waiting for write to be completed (oneway operation), ensuring threadlocals cleanup, adding missing annotation on RM channel handler
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/client/NettyClient.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/client/NettyClient.java 2009-07-14 17:22:44 UTC (rev 10322)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/client/NettyClient.java 2009-07-15 13:24:40 UTC (rev 10323)
@@ -184,11 +184,12 @@
setActualChunkedLength(request);
setAuthorization(request, callProps);
- writeRequest(channel, request, reqMessage);
+ ChannelFuture writeFuture = writeRequest(channel, request, reqMessage);
if (!waitForResponse)
{
- //No need to wait for the connection to be closed
+ //No need to wait for the connection to be closed, just wait for the write to be completed.
+ writeFuture.awaitUninterruptibly();
return null;
}
//Wait for the server to close the connection
@@ -256,11 +257,11 @@
return new InetSocketAddress(target.getHost(), port);
}
- private void writeRequest(Channel channel, HttpRequest request, Object reqMessage) throws IOException
+ private ChannelFuture writeRequest(Channel channel, HttpRequest request, Object reqMessage) throws IOException
{
if (reqMessage == null)
{
- channel.write(request);
+ return channel.write(request);
}
else
{
@@ -286,13 +287,13 @@
cur = to;
}
//write last chunk
- channel.write(HttpChunk.LAST_CHUNK);
+ return channel.write(HttpChunk.LAST_CHUNK);
}
else
{
request.setHeader(HttpHeaders.Names.CONTENT_LENGTH, String.valueOf(content.readableBytes()));
request.setContent(content);
- channel.write(request);
+ return channel.write(request);
}
}
}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/client/WSResponseHandler.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/client/WSResponseHandler.java 2009-07-14 17:22:44 UTC (rev 10322)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/client/WSResponseHandler.java 2009-07-15 13:24:40 UTC (rev 10323)
@@ -31,6 +31,8 @@
import org.jboss.netty.channel.MessageEvent;
import org.jboss.netty.channel.SimpleChannelUpstreamHandler;
import org.jboss.netty.handler.codec.http.HttpResponse;
+import org.jboss.ws.core.utils.ThreadLocalAssociation;
+import org.jboss.wsf.common.DOMUtils;
/**
* A Netty channel upstream handler that receives MessageEvent
@@ -78,6 +80,8 @@
}
finally
{
+ DOMUtils.clearThreadLocals();
+ ThreadLocalAssociation.clear();
e.getChannel().close();
}
}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMBackPortsInvocationHandler.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMBackPortsInvocationHandler.java 2009-07-14 17:22:44 UTC (rev 10322)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/wsrm/transport/backchannel/RMBackPortsInvocationHandler.java 2009-07-15 13:24:40 UTC (rev 10323)
@@ -34,6 +34,7 @@
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBufferInputStream;
import org.jboss.netty.channel.ChannelHandlerContext;
+import org.jboss.netty.channel.ChannelPipelineCoverage;
import org.jboss.netty.channel.ChannelStateEvent;
import org.jboss.netty.channel.ExceptionEvent;
import org.jboss.netty.channel.MessageEvent;
@@ -58,6 +59,7 @@
*
* @since Nov 20, 2007
*/
+@ChannelPipelineCoverage("one")
public final class RMBackPortsInvocationHandler extends SimpleChannelUpstreamHandler
{
private static final Logger LOG = Logger.getLogger(RMBackPortsInvocationHandler.class);
14 years, 9 months
JBossWS SVN: r10322 - common/trunk/src/main/java/org/jboss/wsf/common.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-07-14 13:22:44 -0400 (Tue, 14 Jul 2009)
New Revision: 10322
Modified:
common/trunk/src/main/java/org/jboss/wsf/common/DOMUtils.java
Log:
[JBWS-2554] Prevent concurrent parsing on the same DocumentBuilder instance
Modified: common/trunk/src/main/java/org/jboss/wsf/common/DOMUtils.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/common/DOMUtils.java 2009-07-14 08:20:46 UTC (rev 10321)
+++ common/trunk/src/main/java/org/jboss/wsf/common/DOMUtils.java 2009-07-14 17:22:44 UTC (rev 10322)
@@ -26,9 +26,9 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
-import java.util.LinkedList;
import java.util.HashMap;
import java.util.Iterator;
+import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@@ -130,7 +130,7 @@
builder.setEntityResolver(entityResolver);
}
};
-
+
public static void clearThreadLocals()
{
documentThreadLocal.remove();
@@ -170,7 +170,13 @@
{
try
{
- return getDocumentBuilder().parse(xmlStream).getDocumentElement();
+ Document doc;
+ DocumentBuilder builder = getDocumentBuilder();
+ synchronized (builder) //synchronize to prevent concurrent parsing on the same DocumentBuilder
+ {
+ doc = builder.parse(xmlStream);
+ }
+ return doc.getDocumentElement();
}
catch (SAXException se)
{
@@ -188,7 +194,13 @@
{
try
{
- return getDocumentBuilder().parse(source).getDocumentElement();
+ Document doc;
+ DocumentBuilder builder = getDocumentBuilder();
+ synchronized (builder) //synchronize to prevent concurrent parsing on the same DocumentBuilder
+ {
+ doc = builder.parse(source);
+ }
+ return doc.getDocumentElement();
}
catch (SAXException se)
{
14 years, 9 months