Author: alessio.soldano(a)jboss.com
Date: 2008-09-30 10:33:00 -0400 (Tue, 30 Sep 2008)
New Revision: 8300
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2278/
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2278/JBWS2278TestCase.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2278/ObjectFactory.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2278/TestEndpoint.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2278/TestEndpointImpl.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2278/TestEndpointImplSoap11.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2278/TestEndpointImplSoap12.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2278/TestException.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2278/TestException_Exception.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2278/TestHandler.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2278/package-info.java
framework/trunk/testsuite/test/resources/jaxws/jbws2278/
framework/trunk/testsuite/test/resources/jaxws/jbws2278/WEB-INF/
framework/trunk/testsuite/test/resources/jaxws/jbws2278/WEB-INF/jboss-web.xml
framework/trunk/testsuite/test/resources/jaxws/jbws2278/WEB-INF/web.xml
framework/trunk/testsuite/test/resources/jaxws/jbws2278/WEB-INF/wsdl/
framework/trunk/testsuite/test/resources/jaxws/jbws2278/WEB-INF/wsdl/Test.wsdl
Modified:
framework/trunk/testsuite/test/ant-import/build-jars-jaxws.xml
Log:
[JBWS-2278] Adding testcase
Modified: framework/trunk/testsuite/test/ant-import/build-jars-jaxws.xml
===================================================================
--- framework/trunk/testsuite/test/ant-import/build-jars-jaxws.xml 2008-09-30 09:52:20 UTC
(rev 8299)
+++ framework/trunk/testsuite/test/ant-import/build-jars-jaxws.xml 2008-09-30 14:33:00 UTC
(rev 8300)
@@ -546,6 +546,18 @@
<include name="jboss-web.xml"/>
</webinf>
</war>
+
+ <!-- jaxws-jbws2278 -->
+ <war warfile="${tests.output.dir}/test-libs/jaxws-jbws2278.war"
webxml="${tests.output.dir}/test-resources/jaxws/jbws2278/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/jbws2278/*.class"/>
+ <exclude
name="org/jboss/test/ws/jaxws/jbws2278/JBWS2278TestCase.class"/>
+ </classes>
+ <webinf
dir="${tests.output.dir}/test-resources/jaxws/jbws2278/WEB-INF">
+ <include name="jboss-web.xml"/>
+ <include name="wsdl/*"/>
+ </webinf>
+ </war>
<!-- jaxws namespace -->
<war warfile="${tests.output.dir}/test-libs/jaxws-namespace.war"
webxml="${tests.output.dir}/test-resources/jaxws/namespace/WEB-INF/web.xml">
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2278/JBWS2278TestCase.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2278/JBWS2278TestCase.java
(rev 0)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2278/JBWS2278TestCase.java 2008-09-30
14:33:00 UTC (rev 8300)
@@ -0,0 +1,142 @@
+/*
+ * 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.jbws2278;
+
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPConstants;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+import javax.xml.ws.handler.Handler;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * [JBWS-2278] JBossWS is picking the wrong binding when both Soap1.1 and Soap1.2
bindings are provided for a port
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 30-Sep-2008
+ * @see
https://jira.jboss.org/jira/browse/JBWS-2278
+ */
+public class JBWS2278TestCase extends JBossWSTest
+{
+
+ private static TestEndpoint port11;
+ private static TestEndpoint port12;
+
+ public static Test suite() throws Exception
+ {
+ return new JBossWSTestSetup(JBWS2278TestCase.class,
"jaxws-jbws2278.war");
+ }
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ URL wsdlURL = new URL("http://" + getServerHost() +
":8080/jaxws-jbws2278/soap11?wsdl");
+ QName serviceName = new QName("http://org.jboss.test.ws/jbws2278",
"TestService");
+
+ Service service = Service.create(wsdlURL, serviceName);
+ port11 = service.getPort(new QName("http://org.jboss.test.ws/jbws2278",
"TestEndpointSoap11Port"), TestEndpoint.class);
+ port12 = service.getPort(new QName("http://org.jboss.test.ws/jbws2278",
"TestEndpointSoap12Port"), TestEndpoint.class);
+
+ List<Handler> handlerChain11 = new ArrayList<Handler>();
+ handlerChain11.add(new TestHandler(SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE,
SOAPConstants.SOAP_1_1_CONTENT_TYPE));
+ ((BindingProvider)port11).getBinding().setHandlerChain(handlerChain11);
+
+ List<Handler> handlerChain12 = new ArrayList<Handler>();
+ handlerChain12.add(new TestHandler(SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE,
SOAPConstants.SOAP_1_2_CONTENT_TYPE));
+ ((BindingProvider)port12).getBinding().setHandlerChain(handlerChain12);
+ }
+
+ public void testCallSoap11() throws Exception
+ {
+ final String message = "Hello!!";
+ String response = port11.echo(message);
+ assertEquals(message, response);
+ }
+
+ public void testCheckedExceptionSoap11() throws Exception
+ {
+ try
+ {
+ port11.echo(TestEndpointImpl.TEST_EXCEPTION);
+ fail("Expected TestException not thrown.");
+ }
+ catch (TestException_Exception te)
+ {
+ //OK
+ }
+ }
+
+ public void testRuntimeExceptionSoap11()
+ {
+ try
+ {
+ port11.echo(TestEndpointImpl.RUNTIME_EXCEPTION);
+ fail("Expected Exception not thrown.");
+ }
+ catch (Exception e)
+ {
+ assertEquals("Simulated failure", e.getMessage());
+ }
+ }
+
+ public void testCallSoap12() throws Exception
+ {
+ final String message = "Hello!!";
+ String response = port12.echo(message);
+ assertEquals(message, response);
+ }
+
+ public void testCheckedExceptionSoap12() throws Exception
+ {
+ try
+ {
+ port12.echo(TestEndpointImpl.TEST_EXCEPTION);
+ fail("Expected TestException not thrown.");
+ }
+ catch (TestException_Exception te)
+ {
+ //OK
+ }
+ }
+
+ public void testRuntimeExceptionSoap12()
+ {
+ try
+ {
+ port12.echo(TestEndpointImpl.RUNTIME_EXCEPTION);
+ fail("Expected Exception not thrown.");
+ }
+ catch (Exception e)
+ {
+ assertEquals("Simulated failure", e.getMessage());
+ }
+ }
+
+}
Property changes on:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2278/JBWS2278TestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2278/ObjectFactory.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2278/ObjectFactory.java
(rev 0)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2278/ObjectFactory.java 2008-09-30
14:33:00 UTC (rev 8300)
@@ -0,0 +1,59 @@
+/*
+ * 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.jbws2278;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.annotation.XmlElementDecl;
+import javax.xml.bind.annotation.XmlRegistry;
+import javax.xml.namespace.QName;
+
+
+@XmlRegistry
+public class ObjectFactory {
+
+ private final static QName _TestException_QNAME = new
QName("http://org.jboss.test.ws/jbws2278/types", "TestException");
+
+ /**
+ * Create a new ObjectFactory that can be used to create new instances of schema
derived classes for package: org.jboss.test.ws.jaxws.jbws2278
+ *
+ */
+ public ObjectFactory() {
+ }
+
+ /**
+ * Create an instance of {@link TestException }
+ *
+ */
+ public TestException createTestException() {
+ return new TestException();
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link TestException }{@code
>}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://org.jboss.test.ws/jbws2278/types", name
= "TestException")
+ public JAXBElement<TestException> createTestException(TestException value) {
+ return new JAXBElement<TestException>(_TestException_QNAME,
TestException.class, null, value);
+ }
+
+}
Property changes on:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2278/ObjectFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2278/TestEndpoint.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2278/TestEndpoint.java
(rev 0)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2278/TestEndpoint.java 2008-09-30
14:33:00 UTC (rev 8300)
@@ -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.jbws2278;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.1.3-b02-
+ * Generated source version: 2.0
+ *
+ */
+@WebService(name = "TestEndpoint", targetNamespace =
"http://org.jboss.test.ws/jbws2278")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+public interface TestEndpoint {
+
+ /**
+ *
+ * @param string1
+ * @return returns java.lang.String
+ * @throws TestException_Exception
+ */
+ @WebMethod
+ @WebResult(name = "result", partName = "result")
+ public String echo(@WebParam(name = "String_1", partName =
"String_1") String string1) throws TestException_Exception;
+
+}
Property changes on:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2278/TestEndpoint.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2278/TestEndpointImpl.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2278/TestEndpointImpl.java
(rev 0)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2278/TestEndpointImpl.java 2008-09-30
14:33:00 UTC (rev 8300)
@@ -0,0 +1,52 @@
+/*
+ * 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.jbws2278;
+
+
+/**
+ * Test Endpoint implementation.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 30-Sep-2008
+ */
+public class TestEndpointImpl
+{
+
+ public static final String TEST_EXCEPTION = "TestException";
+
+ public static final String RUNTIME_EXCEPTION = "RuntimeException";
+
+ public String echo(String message) throws TestException_Exception
+ {
+ if (TEST_EXCEPTION.equals(message))
+ {
+ TestException te = new TestException();
+ throw new TestException_Exception(message, te);
+ }
+ else if (RUNTIME_EXCEPTION.equals(message))
+ {
+ throw new RuntimeException("Simulated failure");
+ }
+ return message;
+ }
+
+}
Property changes on:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2278/TestEndpointImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2278/TestEndpointImplSoap11.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2278/TestEndpointImplSoap11.java
(rev 0)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2278/TestEndpointImplSoap11.java 2008-09-30
14:33:00 UTC (rev 8300)
@@ -0,0 +1,39 @@
+/*
+ * 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.jbws2278;
+
+import javax.jws.WebService;
+import javax.xml.ws.BindingType;
+import javax.xml.ws.soap.SOAPBinding;
+
+/**
+ * Test Endpoint implementation - SOAP 1.1 port.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 30-Sep-2008
+ */
+@WebService(name = "TestEndpoint", portName="TestEndpointSoap11Port",
targetNamespace = "http://org.jboss.test.ws/jbws2278", endpointInterface =
"org.jboss.test.ws.jaxws.jbws2278.TestEndpoint",
wsdlLocation="WEB-INF/wsdl/Test.wsdl")
+(a)BindingType(SOAPBinding.SOAP11HTTP_BINDING)
+public class TestEndpointImplSoap11 extends TestEndpointImpl implements TestEndpoint
+{
+
+}
Property changes on:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2278/TestEndpointImplSoap11.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2278/TestEndpointImplSoap12.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2278/TestEndpointImplSoap12.java
(rev 0)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2278/TestEndpointImplSoap12.java 2008-09-30
14:33:00 UTC (rev 8300)
@@ -0,0 +1,39 @@
+/*
+ * 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.jbws2278;
+
+import javax.jws.WebService;
+import javax.xml.ws.BindingType;
+import javax.xml.ws.soap.SOAPBinding;
+
+/**
+ * Test Endpoint implementation - SOAP 1.2 port.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 30-Sep-2008
+ */
+@WebService(name = "TestEndpoint", portName="TestEndpointSoap12Port",
targetNamespace = "http://org.jboss.test.ws/jbws2278", endpointInterface =
"org.jboss.test.ws.jaxws.jbws2278.TestEndpoint",
wsdlLocation="WEB-INF/wsdl/Test.wsdl")
+(a)BindingType(SOAPBinding.SOAP12HTTP_BINDING)
+public class TestEndpointImplSoap12 extends TestEndpointImpl implements TestEndpoint
+{
+
+}
Property changes on:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2278/TestEndpointImplSoap12.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2278/TestException.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2278/TestException.java
(rev 0)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2278/TestException.java 2008-09-30
14:33:00 UTC (rev 8300)
@@ -0,0 +1,52 @@
+/*
+ * 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.jbws2278;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for TestException complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within
this class.
+ *
+ * <pre>
+ * <complexType name="TestException">
+ * <complexContent>
+ * <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "TestException")
+public class TestException {
+
+
+}
Property changes on:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2278/TestException.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2278/TestException_Exception.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2278/TestException_Exception.java
(rev 0)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2278/TestException_Exception.java 2008-09-30
14:33:00 UTC (rev 8300)
@@ -0,0 +1,74 @@
+/*
+ * 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.jbws2278;
+
+import javax.xml.ws.WebFault;
+
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.1.3-b02-
+ * Generated source version: 2.0
+ *
+ */
+@WebFault(name = "TestException", targetNamespace =
"http://org.jboss.test.ws/jbws2278/types")
+public class TestException_Exception
+ extends Exception
+{
+
+ /**
+ * Java type that goes as soapenv:Fault detail element.
+ *
+ */
+ private TestException faultInfo;
+
+ /**
+ *
+ * @param faultInfo
+ * @param message
+ */
+ public TestException_Exception(String message, TestException faultInfo) {
+ super(message);
+ this.faultInfo = faultInfo;
+ }
+
+ /**
+ *
+ * @param faultInfo
+ * @param message
+ * @param cause
+ */
+ public TestException_Exception(String message, TestException faultInfo, Throwable
cause) {
+ super(message, cause);
+ this.faultInfo = faultInfo;
+ }
+
+ /**
+ *
+ * @return
+ * returns fault bean: org.jboss.test.ws.jaxws.jbws2234.TestException
+ */
+ public TestException getFaultInfo() {
+ return faultInfo;
+ }
+
+}
Property changes on:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2278/TestException_Exception.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2278/TestHandler.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2278/TestHandler.java
(rev 0)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2278/TestHandler.java 2008-09-30
14:33:00 UTC (rev 8300)
@@ -0,0 +1,120 @@
+/*
+ * 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.jbws2278;
+
+import javax.xml.soap.MimeHeaders;
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.soap.SOAPPart;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+
+import org.jboss.wsf.common.handler.GenericSOAPHandler;
+
+/**
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 30-Sep-2008
+ */
+public class TestHandler extends GenericSOAPHandler
+{
+ private String envelopeNamespace;
+ private String contentType;
+
+ public TestHandler(String envelopeNamespace, String contentType)
+ {
+ super();
+ this.envelopeNamespace = envelopeNamespace;
+ this.contentType = contentType;
+ }
+
+ public void close(MessageContext context)
+ {
+ }
+
+ public boolean handleFault(MessageContext context)
+ {
+ return handleMessage(context);
+ }
+
+ public boolean handleInbound(MessageContext context)
+ {
+ try
+ {
+ SOAPMessage soapMessage = ((SOAPMessageContext)context).getMessage();
+ checkEnvelope(soapMessage);
+ checkContentType(soapMessage);
+ return true;
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public boolean handleOutbound(MessageContext context)
+ {
+ try
+ {
+ SOAPMessage soapMessage = ((SOAPMessageContext)context).getMessage();
+ soapMessage.saveChanges();
+ checkEnvelope(soapMessage);
+ checkContentType(soapMessage);
+ return true;
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ private void checkEnvelope(SOAPMessage soapMessage) throws SOAPException
+ {
+ SOAPPart part = soapMessage.getSOAPPart();
+ SOAPEnvelope envelope = part.getEnvelope();
+
+ String namespace = envelope.getNamespaceURI();
+ if (envelopeNamespace.equals(namespace) == false)
+ {
+ throw new RuntimeException("Expected '" + envelopeNamespace +
"' namespace, actual '" + namespace + "'");
+ }
+ }
+
+ private void checkContentType(SOAPMessage soapMessage)
+ {
+ MimeHeaders mimeHeaders = soapMessage.getMimeHeaders();
+ String[] ct = mimeHeaders.getHeader("Content-Type");
+ boolean found = false;
+ if (ct != null)
+ {
+ for (int i = 0; i < ct.length; i++)
+ {
+ if (ct[i].startsWith(contentType))
+ found = true;
+ }
+ }
+ if (!found)
+ throw new RuntimeException("Expected '" + contentType +
"' content-type not found in the headers");
+ }
+
+}
Property changes on:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2278/TestHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2278/package-info.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2278/package-info.java
(rev 0)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2278/package-info.java 2008-09-30
14:33:00 UTC (rev 8300)
@@ -0,0 +1,23 @@
+/*
+ * 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.
+ */
+(a)javax.xml.bind.annotation.XmlSchema(namespace =
"http://org.jboss.test.ws/jbws2278/types")
+package org.jboss.test.ws.jaxws.jbws2278;
Property changes on:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2278/package-info.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: framework/trunk/testsuite/test/resources/jaxws/jbws2278/WEB-INF/jboss-web.xml
===================================================================
--- framework/trunk/testsuite/test/resources/jaxws/jbws2278/WEB-INF/jboss-web.xml
(rev 0)
+++
framework/trunk/testsuite/test/resources/jaxws/jbws2278/WEB-INF/jboss-web.xml 2008-09-30
14:33:00 UTC (rev 8300)
@@ -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-jbws2278</context-root>
+</jboss-web>
\ No newline at end of file
Property changes on:
framework/trunk/testsuite/test/resources/jaxws/jbws2278/WEB-INF/jboss-web.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: framework/trunk/testsuite/test/resources/jaxws/jbws2278/WEB-INF/web.xml
===================================================================
--- framework/trunk/testsuite/test/resources/jaxws/jbws2278/WEB-INF/web.xml
(rev 0)
+++ framework/trunk/testsuite/test/resources/jaxws/jbws2278/WEB-INF/web.xml 2008-09-30
14:33:00 UTC (rev 8300)
@@ -0,0 +1,26 @@
+<?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>TestEndpointSoap11</servlet-name>
+
<servlet-class>org.jboss.test.ws.jaxws.jbws2278.TestEndpointImplSoap11</servlet-class>
+ </servlet>
+
+ <servlet>
+ <servlet-name>TestEndpointSoap12</servlet-name>
+
<servlet-class>org.jboss.test.ws.jaxws.jbws2278.TestEndpointImplSoap12</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>TestEndpointSoap11</servlet-name>
+ <url-pattern>/soap11/*</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>TestEndpointSoap12</servlet-name>
+ <url-pattern>/soap12/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
\ No newline at end of file
Property changes on:
framework/trunk/testsuite/test/resources/jaxws/jbws2278/WEB-INF/web.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: framework/trunk/testsuite/test/resources/jaxws/jbws2278/WEB-INF/wsdl/Test.wsdl
===================================================================
--- framework/trunk/testsuite/test/resources/jaxws/jbws2278/WEB-INF/wsdl/Test.wsdl
(rev 0)
+++
framework/trunk/testsuite/test/resources/jaxws/jbws2278/WEB-INF/wsdl/Test.wsdl 2008-09-30
14:33:00 UTC (rev 8300)
@@ -0,0 +1,67 @@
+<definitions name='TestService'
targetNamespace='http://org.jboss.test.ws/jbws2278'
xmlns='http://schemas.xmlsoap.org/wsdl/'
xmlns:ns1='http://org.jboss.test.ws/jbws2278/types'
xmlns:soap12='http://schemas.xmlsoap.org/wsdl/soap12/'
xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
xmlns:tns='http://org.jboss.test.ws/jbws2278'
xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
+ <types>
+ <schema targetNamespace='http://org.jboss.test.ws/jbws2278/types'
xmlns='http://www.w3.org/2001/XMLSchema'
xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/'
xmlns:tns='http://org.jboss.test.ws/jbws2278/types'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
+ <complexType name='TestException'>
+ <sequence/>
+ </complexType>
+ <element name='TestException' type='tns:TestException'/>
+ </schema>
+ </types>
+
+ <message name='TestException'
xmlns='http://schemas.xmlsoap.org/wsdl/'>
+ <part element='ns1:TestException'
name='TestException'></part>
+ </message>
+ <message name='TestEndpoint_echoResponse'>
+ <part name='result' type='xsd:string'></part>
+ </message>
+ <message name='TestEndpoint_echo'>
+ <part name='String_1' type='xsd:string'></part>
+ </message>
+
+ <portType name='TestEndpoint'>
+ <operation name='echo' parameterOrder='String_1'>
+ <input message='tns:TestEndpoint_echo'></input>
+ <output message='tns:TestEndpoint_echoResponse'></output>
+ <fault message='tns:TestException'
name='TestException'></fault>
+ </operation>
+ </portType>
+ <binding name='TestEndpointSoap11Binding'
type='tns:TestEndpoint'>
+ <soap:binding style='rpc'
transport='http://schemas.xmlsoap.org/soap/http'/>
+ <operation name='echo'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body namespace='http://org.jboss.test.ws/jbws2278'
use='literal'/>
+ </input>
+ <output>
+ <soap:body namespace='http://org.jboss.test.ws/jbws2278'
use='literal'/>
+ </output>
+ <fault name='TestException'>
+ <soap:fault name='TestException' use='literal'/>
+ </fault>
+ </operation>
+ </binding>
+ <binding name='TestEndpointSoap12Binding'
type='tns:TestEndpoint'>
+ <soap12:binding style='rpc'
transport='http://schemas.xmlsoap.org/soap/http'/>
+ <operation name='echo'>
+ <soap12:operation soapAction=''/>
+ <input>
+ <soap12:body namespace='http://org.jboss.test.ws/jbws2278'
use='literal'/>
+ </input>
+ <output>
+ <soap12:body namespace='http://org.jboss.test.ws/jbws2278'
use='literal'/>
+ </output>
+ <fault name='TestException'>
+ <soap12:fault name='TestException' use='literal'/>
+ </fault>
+ </operation>
+ </binding>
+ <service name='TestService'>
+ <port binding='tns:TestEndpointSoap11Binding'
name='TestEndpointSoap11Port'>
+ <soap:address
location='http://REPLACE_WITH_ACTUAL_URL/jaxws-jbws2278/soap11'/>
+ </port>
+ <port binding='tns:TestEndpointSoap12Binding'
name='TestEndpointSoap12Port'>
+ <soap12:address
location='http://REPLACE_WITH_ACTUAL_URL/jaxws-jbws2278/soap12'/>
+ </port>
+ </service>
+
+</definitions>
\ No newline at end of file
Property changes on:
framework/trunk/testsuite/test/resources/jaxws/jbws2278/WEB-INF/wsdl/Test.wsdl
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF