JBossWS SVN: r9676 - stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-03-24 14:34:35 -0400 (Tue, 24 Mar 2009)
New Revision: 9676
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/AddressingPropertiesImpl.java
Log:
[JBWS-2166] Copy provided parameters when initializing AddressingProperties
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/AddressingPropertiesImpl.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/AddressingPropertiesImpl.java 2009-03-24 18:33:15 UTC (rev 9675)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/extensions/addressing/AddressingPropertiesImpl.java 2009-03-24 18:34:35 UTC (rev 9676)
@@ -178,7 +178,7 @@
{
SOAPElement soapElement = (SOAPElement)obj;
soapElement.setAttributeNS(getNamespaceURI(), "wsa:IsReferenceParameter", "true");
- addElement(soapElement);
+ addElement(soapElement.cloneNode(true));
}
this.initialized = true;
@@ -213,7 +213,7 @@
{
SOAPElement soapElement = (SOAPElement)obj;
soapElement.setAttributeNS(getNamespaceURI(), "wsa:IsReferenceParameter", "true");
- addElement(soapElement);
+ addElement(soapElement.cloneNode(true));
}
}
if (props.getMessageID() != null)
15 years, 9 months
JBossWS SVN: r9675 - in stack/native/trunk/modules/testsuite/native-tests: src/test/java/org/jboss/test/ws/jaxws and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-03-24 14:33:15 -0400 (Tue, 24 Mar 2009)
New Revision: 9675
Added:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2166/
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2166/EndpointA.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2166/EndpointB.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2166/EndpointImplA.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2166/EndpointImplB.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2166/JBWS2166TestCase.java
Modified:
stack/native/trunk/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml
Log:
[JBWS-2166] Adding testcase
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-03-24 13:29:09 UTC (rev 9674)
+++ stack/native/trunk/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml 2009-03-24 18:33:15 UTC (rev 9675)
@@ -360,6 +360,21 @@
</metainf>
</jar>
+ <!-- jaxws-jbws2166-->
+ <jar destfile="${tests.output.dir}/test-libs/jaxws-jbws2166-A.jar">
+ <fileset dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/jbws2166/EndpointA.class"/>
+ <include name="org/jboss/test/ws/jaxws/jbws2166/EndpointB.class"/>
+ <include name="org/jboss/test/ws/jaxws/jbws2166/EndpointImplA.class"/>
+ </fileset>
+ </jar>
+ <jar destfile="${tests.output.dir}/test-libs/jaxws-jbws2166-B.jar">
+ <fileset dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/jbws2166/EndpointB.class"/>
+ <include name="org/jboss/test/ws/jaxws/jbws2166/EndpointImplB.class"/>
+ </fileset>
+ </jar>
+
<!-- jaxws-jbws2182-->
<jar destfile="${tests.output.dir}/test-libs/jaxws-jbws2182.jar">
<fileset dir="${tests.output.dir}/test-classes">
@@ -456,8 +471,8 @@
<webinf dir="${tests.output.dir}/test-resources/jaxws/jbws2319/WEB-INF">
<include name="jboss-web.xml"/>
</webinf>
- </war>
-
+ </war>
+
<!-- jaxws-jbws2437 -->
<jar destfile="${tests.output.dir}/test-libs/jaxws-jbws2437.jar">
<fileset dir="${tests.output.dir}/test-classes">
Added: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2166/EndpointA.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2166/EndpointA.java (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2166/EndpointA.java 2009-03-24 18:33:15 UTC (rev 9675)
@@ -0,0 +1,34 @@
+/*
+ * 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.jbws2166;
+
+import javax.jws.Oneway;
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+
+@WebService(name = "EndpointA", targetNamespace = "http://org.jboss.ws/jbws2166")
+public interface EndpointA
+{
+ @Oneway
+ @WebMethod(action="echo")
+ public void echo(String s);
+}
Property changes on: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2166/EndpointA.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/jbws2166/EndpointB.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2166/EndpointB.java (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2166/EndpointB.java 2009-03-24 18:33:15 UTC (rev 9675)
@@ -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.test.ws.jaxws.jbws2166;
+
+import javax.jws.Oneway;
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+
+@WebService(name = "EndpointB", targetNamespace = "http://org.jboss.ws/jbws2166")
+public interface EndpointB
+{
+ @Oneway
+ @WebMethod(action="echo")
+ public void echo(String s);
+
+ @WebMethod(action="getString")
+ public String getString();
+}
Property changes on: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2166/EndpointB.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/jbws2166/EndpointImplA.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2166/EndpointImplA.java (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2166/EndpointImplA.java 2009-03-24 18:33:15 UTC (rev 9675)
@@ -0,0 +1,85 @@
+/*
+ * 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.jbws2166;
+
+import java.net.URI;
+import java.net.URL;
+
+import javax.annotation.Resource;
+import javax.ejb.Stateless;
+import javax.jws.Oneway;
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.addressing.AddressingBuilder;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.JAXWSAConstants;
+import javax.xml.ws.soap.Addressing;
+import javax.xml.ws.soap.AddressingFeature;
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.spi.annotation.WebContext;
+
+@Stateless
+@WebService(name = "EndpointA", serviceName = "EndpointAService", targetNamespace = "http://org.jboss.ws/jbws2166")
+@WebContext(contextRoot = "/jaxws-jbws2166-A", urlPattern = "/*")
+@Addressing
+public class EndpointImplA implements EndpointA
+{
+ private Logger log = Logger.getLogger(EndpointImplA.class);
+
+ @Resource
+ protected WebServiceContext ctx;
+
+ @Oneway
+ @WebMethod(action="echo")
+ public void echo(String s)
+ {
+ log.info("ECHO: " + s);
+ try
+ {
+ AddressingProperties serverProps = (AddressingProperties)ctx.getMessageContext().get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+ URI endpointUri = serverProps.getReplyTo().getAddress().getURI();
+ URL wsdlURL = new URL(endpointUri.toString() + "?wsdl");
+ QName serviceName = new QName("http://org.jboss.ws/jbws2166", "EndpointBService");
+
+ Service service = Service.create(wsdlURL, serviceName);
+ EndpointB port = (EndpointB)service.getPort(EndpointB.class, new AddressingFeature());
+ BindingProvider bindingProvider = (BindingProvider)port;
+
+ AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
+ AddressingProperties props = builder.newAddressingProperties();
+ props.initializeAsReply(serverProps, false);
+ props.setAction(builder.newURI("echo"));
+
+ bindingProvider.getRequestContext().put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, props);
+ port.echo(s);
+ }
+ catch (Exception e)
+ {
+ log.error("Error while calling Service B", e);
+ }
+ }
+}
Property changes on: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2166/EndpointImplA.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/jbws2166/EndpointImplB.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2166/EndpointImplB.java (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2166/EndpointImplB.java 2009-03-24 18:33:15 UTC (rev 9675)
@@ -0,0 +1,55 @@
+/*
+ * 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.jbws2166;
+
+import javax.ejb.Stateless;
+import javax.jws.Oneway;
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.xml.ws.soap.Addressing;
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.spi.annotation.WebContext;
+
+@Stateless
+@WebService(name = "EndpointB", serviceName = "EndpointBService", targetNamespace = "http://org.jboss.ws/jbws2166")
+@WebContext(contextRoot = "/jaxws-jbws2166-B", urlPattern = "/*")
+@Addressing
+public class EndpointImplB implements EndpointB
+{
+ private Logger log = Logger.getLogger(EndpointImplB.class);
+ private static String lastString;
+
+ @Oneway
+ @WebMethod(action="echo")
+ public void echo(String s)
+ {
+ log.info("ECHO: " + s);
+ lastString = s;
+ }
+
+ @WebMethod
+ public String getString()
+ {
+ return lastString;
+ }
+}
Property changes on: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2166/EndpointImplB.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/jbws2166/JBWS2166TestCase.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2166/JBWS2166TestCase.java (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2166/JBWS2166TestCase.java 2009-03-24 18:33:15 UTC (rev 9675)
@@ -0,0 +1,87 @@
+/*
+ * 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.jbws2166;
+
+import java.net.URI;
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+import javax.xml.ws.addressing.AddressingBuilder;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.EndpointReference;
+import javax.xml.ws.addressing.JAXWSAConstants;
+import javax.xml.ws.soap.AddressingFeature;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.common.DOMUtils;
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+import org.w3c.dom.Element;
+
+/**
+ * [JBWS-2166] WSA client handler throws exception when installing reference parameters
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 24-Mar-2009
+ *
+ */
+public class JBWS2166TestCase extends JBossWSTest
+{
+ public static Test suite() throws Exception
+ {
+ return new JBossWSTestSetup(JBWS2166TestCase.class, "jaxws-jbws2166-A.jar jaxws-jbws2166-B.jar");
+ }
+
+ public void test() throws Exception
+ {
+ String endpointAUrl = "http://" + getServerHost() + ":8080/jaxws-jbws2166-A";
+ String endpointBUrl = "http://" + getServerHost() + ":8080/jaxws-jbws2166-B";
+ QName serviceNameA = new QName("http://org.jboss.ws/jbws2166", "EndpointAService");
+ QName serviceNameB = new QName("http://org.jboss.ws/jbws2166", "EndpointBService");
+ Service serviceA = Service.create(new URL(endpointAUrl + "?wsdl"), serviceNameA);
+ Service serviceB = Service.create(new URL(endpointBUrl + "?wsdl"), serviceNameB);
+ EndpointA portA = (EndpointA)serviceA.getPort(EndpointA.class, new AddressingFeature());
+ EndpointB portB = (EndpointB)serviceB.getPort(EndpointB.class, new AddressingFeature());
+ BindingProvider bindingProviderA = (BindingProvider)portA;
+
+ AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
+ AddressingProperties props = builder.newAddressingProperties();
+ props.setAction(builder.newURI("echo"));
+ EndpointReference epr = builder.newEndpointReference(new URI(endpointBUrl));
+ Element element = DOMUtils.parse("<wsarj:identifier xmlns:wsarj='myNS'>MyIdentifier</wsarj:identifier>");
+ epr.getReferenceParameters().addElement(element);
+ props.setReplyTo(epr);
+ props.setTo(builder.newURI(new URI(endpointAUrl)));
+ props.setMessageID(builder.newURI("TestMessageID"));
+
+ bindingProviderA.getRequestContext().put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, props);
+ portA.echo("Hi!");
+
+ Thread.sleep(2000);
+ String result = portB.getString();
+
+ assertEquals("Hi!", result);
+ }
+}
Property changes on: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2166/JBWS2166TestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
15 years, 9 months