Author: alessio.soldano(a)jboss.com
Date: 2013-07-11 12:19:17 -0400 (Thu, 11 Jul 2013)
New Revision: 17768
Added:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/exception/SOAP12ExceptionEJB3Helper.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/exception/SOAP12ExceptionHelper.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/exception/server/SOAP12EndpointImpl.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/exception/server/SOAP12ExceptionEndpointEJB3Impl.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/exception/server/SOAP12ExceptionEndpointImpl.java
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/ant-import/build-samples-jaxws.xml
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/exception/ExceptionEJB3TestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/exception/ExceptionHelper.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/exception/ExceptionServletTestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/exception/ExceptionTestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/exception/server/EndpointImpl.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/samples/exception/WEB-INF/web.xml
Log:
[JBWS-3601][WFLY-1667] Adding testcase
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/ant-import/build-samples-jaxws.xml
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/ant-import/build-samples-jaxws.xml 2013-07-11
12:37:03 UTC (rev 17767)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/ant-import/build-samples-jaxws.xml 2013-07-11
16:19:17 UTC (rev 17768)
@@ -113,8 +113,10 @@
<classes dir="${tests.output.dir}/test-classes">
<include
name="org/jboss/test/ws/jaxws/samples/exception/server/jaxws/**"/>
<include
name="org/jboss/test/ws/jaxws/samples/exception/server/EndpointImpl.class"/>
+ <include
name="org/jboss/test/ws/jaxws/samples/exception/server/SOAP12EndpointImpl.class"/>
<include
name="org/jboss/test/ws/jaxws/samples/exception/server/ExceptionEndpoint.class"/>
<include
name="org/jboss/test/ws/jaxws/samples/exception/server/ExceptionEndpointImpl.class"/>
+ <include
name="org/jboss/test/ws/jaxws/samples/exception/server/SOAP12ExceptionEndpointImpl.class"/>
<include
name="org/jboss/test/ws/jaxws/samples/exception/server/UserException.class"/>
<include
name="org/jboss/test/ws/jaxws/samples/exception/server/ServerHandler.class"/>
<include
name="org/jboss/test/ws/jaxws/samples/exception/server/jaxws-handlers-server.xml"/>
@@ -124,8 +126,10 @@
<fileset dir="${tests.output.dir}/test-classes">
<include
name="org/jboss/test/ws/jaxws/samples/exception/server/jaxws/**"/>
<include
name="org/jboss/test/ws/jaxws/samples/exception/server/EndpointImpl.class"/>
+ <include
name="org/jboss/test/ws/jaxws/samples/exception/server/SOAP12EndpointImpl.class"/>
<include
name="org/jboss/test/ws/jaxws/samples/exception/server/ExceptionEndpoint.class"/>
<include
name="org/jboss/test/ws/jaxws/samples/exception/server/ExceptionEndpointEJB3Impl.class"/>
+ <include
name="org/jboss/test/ws/jaxws/samples/exception/server/SOAP12ExceptionEndpointEJB3Impl.class"/>
<include
name="org/jboss/test/ws/jaxws/samples/exception/server/UserException.class"/>
<include
name="org/jboss/test/ws/jaxws/samples/exception/server/ServerHandler.class"/>
<include
name="org/jboss/test/ws/jaxws/samples/exception/server/jaxws-handlers-server.xml"/>
@@ -135,6 +139,7 @@
<classes dir="${tests.output.dir}/test-classes">
<include
name="org/jboss/test/ws/jaxws/samples/exception/client/**"/>
<include
name="org/jboss/test/ws/jaxws/samples/exception/ExceptionHelper.class"/>
+ <include
name="org/jboss/test/ws/jaxws/samples/exception/SOAP12ExceptionHelper.class"/>
<include name="org/jboss/test/helper/ClientHelper.class"/>
<include name="org/jboss/test/helper/TestServlet.class"/>
</classes>
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/exception/ExceptionEJB3TestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/exception/ExceptionEJB3TestCase.java 2013-07-11
12:37:03 UTC (rev 17767)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/exception/ExceptionEJB3TestCase.java 2013-07-11
16:19:17 UTC (rev 17768)
@@ -42,4 +42,9 @@
{
return new ExceptionEJB3Helper("http://" + getServerHost() +
":8080/jaxws-samples-exception/ExceptionEndpointEJB3Impl");
}
+
+ protected SOAP12ExceptionHelper getSOAP12Helper()
+ {
+ return new SOAP12ExceptionEJB3Helper("http://" + getServerHost() +
":8080/jaxws-samples-exception/SOAP12ExceptionEndpointEJB3Impl");
+ }
}
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/exception/ExceptionHelper.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/exception/ExceptionHelper.java 2013-07-11
12:37:03 UTC (rev 17767)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/exception/ExceptionHelper.java 2013-07-11
16:19:17 UTC (rev 17768)
@@ -99,8 +99,8 @@
{
assertEquals("THIS IS A FAULT STRING!",
e.getFault().getFaultString());
assertEquals("mr.actor", e.getFault().getFaultActor());
- assertEquals("FooCode",
e.getFault().getFaultCodeAsName().getLocalName());
- assertEquals("http://foo",
e.getFault().getFaultCodeAsName().getURI());
+ assertEquals("VersionMismatch",
e.getFault().getFaultCodeAsName().getLocalName());
+
assertEquals("http://www.w3.org/2003/05/soap-envelope",
e.getFault().getFaultCodeAsName().getURI());
assertEquals("test",
((Element)e.getFault().getDetail().getChildElements().next()).getLocalName());
}
}
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/exception/ExceptionServletTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/exception/ExceptionServletTestCase.java 2013-07-11
12:37:03 UTC (rev 17767)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/exception/ExceptionServletTestCase.java 2013-07-11
16:19:17 UTC (rev 17768)
@@ -52,6 +52,21 @@
assertEquals("1",
runTestInContainer("testApplicationException"));
}
+ public void testRuntimeExceptionSOAP12() throws Exception
+ {
+ assertEquals("1",
runTestInContainerSOAP12("testRuntimeException"));
+ }
+
+ public void testSoapFaultExceptionSOAP12() throws Exception
+ {
+ assertEquals("1",
runTestInContainerSOAP12("testSoapFaultException"));
+ }
+
+ public void testApplicationExceptionSOAP12() throws Exception
+ {
+ assertEquals("1",
runTestInContainerSOAP12("testApplicationException"));
+ }
+
private String runTestInContainer(String test) throws Exception
{
URL url = new URL("http://" + getServerHost()
@@ -60,4 +75,13 @@
BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
return br.readLine();
}
+
+ private String runTestInContainerSOAP12(String test) throws Exception
+ {
+ URL url = new URL("http://" + getServerHost()
+ +
":8080/jaxws-samples-exception-client?path=/jaxws-samples-exception-jse/SOAP12ExceptionEndpointService&method="
+ test
+ + "&helper=" + SOAP12ExceptionHelper.class.getName());
+ BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
+ return br.readLine();
+ }
}
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/exception/ExceptionTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/exception/ExceptionTestCase.java 2013-07-11
12:37:03 UTC (rev 17767)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/exception/ExceptionTestCase.java 2013-07-11
16:19:17 UTC (rev 17768)
@@ -21,6 +21,9 @@
*/
package org.jboss.test.ws.jaxws.samples.exception;
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
+
import junit.framework.Test;
import org.jboss.wsf.test.JBossWSTest;
@@ -46,7 +49,7 @@
}
catch (Exception e)
{
- fail(e.getMessage());
+ fail(e);
}
}
@@ -58,7 +61,7 @@
}
catch (Exception e)
{
- fail(e.getMessage());
+ fail(e);
}
}
@@ -70,12 +73,61 @@
}
catch (Exception e)
{
- fail(e.getMessage());
+ fail(e);
}
}
+ public void testSOAP12RuntimeException() throws Exception
+ {
+ try
+ {
+ getSOAP12Helper().testRuntimeException();
+ }
+ catch (Exception e)
+ {
+ fail(e);
+ }
+ }
+
+ public void testSOAP12SoapFaultException() throws Exception
+ {
+ try
+ {
+ getSOAP12Helper().testSoapFaultException();
+ }
+ catch (Exception e)
+ {
+ fail(e);
+ }
+ }
+
+ public void testSOAP12ApplicationException() throws Exception
+ {
+ try
+ {
+ getSOAP12Helper().testApplicationException();
+ }
+ catch (Exception e)
+ {
+ fail(e);
+ }
+ }
+
+ private static void fail(Exception e) {
+ ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ PrintStream ps = new PrintStream(bos);
+ e.printStackTrace(ps);
+ fail(bos.toString());
+ ps.close();
+ }
+
protected ExceptionHelper getHelper()
{
return new ExceptionHelper("http://" + getServerHost() +
":8080/jaxws-samples-exception-jse/ExceptionEndpointService");
}
+
+ protected SOAP12ExceptionHelper getSOAP12Helper()
+ {
+ return new SOAP12ExceptionHelper("http://" + getServerHost() +
":8080/jaxws-samples-exception-jse/SOAP12ExceptionEndpointService");
+ }
}
Added:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/exception/SOAP12ExceptionEJB3Helper.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/exception/SOAP12ExceptionEJB3Helper.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/exception/SOAP12ExceptionEJB3Helper.java 2013-07-11
16:19:17 UTC (rev 17768)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.samples.exception;
+
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+import org.jboss.test.ws.jaxws.samples.exception.client.ExceptionEndpoint;
+
+public class SOAP12ExceptionEJB3Helper extends SOAP12ExceptionHelper
+{
+ public SOAP12ExceptionEJB3Helper(String targetEndpoint)
+ {
+ super(targetEndpoint);
+ }
+
+ public SOAP12ExceptionEJB3Helper()
+ {
+ super();
+ }
+
+ protected ExceptionEndpoint getProxy() throws Exception
+ {
+ QName serviceName = new QName(targetNS,
"SOAP12ExceptionEndpointEJB3ImplService");
+ URL wsdlURL = new URL(targetEndpoint + "?wsdl");
+
+ Service service = Service.create(wsdlURL, serviceName);
+ return service.getPort(ExceptionEndpoint.class);
+ }
+}
Added:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/exception/SOAP12ExceptionHelper.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/exception/SOAP12ExceptionHelper.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/exception/SOAP12ExceptionHelper.java 2013-07-11
16:19:17 UTC (rev 17768)
@@ -0,0 +1,153 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.samples.exception;
+
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import javax.xml.ws.soap.SOAPFaultException;
+
+import org.jboss.test.helper.ClientHelper;
+import org.jboss.test.ws.jaxws.samples.exception.client.ExceptionEndpoint;
+import org.jboss.test.ws.jaxws.samples.exception.client.UserException;
+import org.jboss.test.ws.jaxws.samples.exception.client.UserException_Exception;
+import org.w3c.dom.Element;
+
+public class SOAP12ExceptionHelper implements ClientHelper
+{
+ protected String targetEndpoint;
+ protected String targetNS =
"http://server.exception.samples.jaxws.ws.test.jboss.org/";
+
+ public SOAP12ExceptionHelper(String targetEndpoint)
+ {
+ this.targetEndpoint = targetEndpoint;
+ }
+
+ public SOAP12ExceptionHelper()
+ {
+ //NOOP
+ }
+
+ protected ExceptionEndpoint getProxy() throws Exception
+ {
+ QName serviceName = new QName(targetNS,
"SOAP12ExceptionEndpointImplService");
+ URL wsdlURL = new URL(targetEndpoint + "?wsdl");
+
+ Service service = Service.create(wsdlURL, serviceName);
+ return service.getPort(ExceptionEndpoint.class);
+ }
+
+ /*
+ * 10.2.2.3
+ *
+ * faultcode (Subcode in SOAP 1.2, Code set to env:Receiver)
+ * 1. SOAPFaultException.getFault().getFaultCodeAsQName()
+ * 2. env:Server (Subcode omitted for SOAP 1.2).
+ * faultstring (Reason/Text)
+ * 1. SOAPFaultException.getFault().getFaultString()
+ * 2. Exception.getMessage()
+ * 3. Exception.toString()
+ * faultactor (Role in SOAP 1.2)
+ * 1. SOAPFaultException.getFault().getFaultActor()
+ * 2. Empty
+ * detail (Detail in SOAP 1.2)
+ * 1. Serialized service specific exception (see WrapperException.getFaultInfo() in
section 2.5)
+ * 2. SOAPFaultException.getFault().getDetail()
+ */
+ public void testRuntimeException() throws Exception
+ {
+ try
+ {
+ getProxy().throwRuntimeException();
+ fail("Expected SOAPFaultException");
+ }
+ catch (SOAPFaultException e)
+ {
+ String faultString = e.getFault().getFaultString();
+ assertTrue(faultString.indexOf("oh no, a runtime exception occured.")
>= 0);
+ }
+ }
+
+ public void testSoapFaultException() throws Exception
+ {
+ try
+ {
+ getProxy().throwSoapFaultException();
+ fail("Expected SOAPFaultException");
+ }
+ catch (SOAPFaultException e)
+ {
+ assertEquals("this is a fault string!",
e.getFault().getFaultString());
+ assertEquals("mr.actor", e.getFault().getFaultActor());
+ assertEquals("VersionMismatch",
e.getFault().getFaultCodeAsName().getLocalName());
+
assertEquals("http://www.w3.org/2003/05/soap-envelope",
e.getFault().getFaultCodeAsName().getURI());
+ final QName subcode = (QName)e.getFault().getFaultSubcodes().next();
+
assertEquals("http://ws.gss.redhat.com/", subcode.getNamespaceURI());
+ assertEquals("NullPointerException", subcode.getLocalPart());
+ assertEquals("test",
((Element)e.getFault().getDetail().getChildElements().next()).getLocalName());
+ }
+ }
+
+ public void testApplicationException() throws Exception
+ {
+ try
+ {
+ getProxy().throwApplicationException();
+ fail("Expected UserException");
+ }
+ catch (UserException_Exception e)
+ {
+ UserException ue = e.getFaultInfo();
+ assertEquals("Some validation error", ue.getMessage());
+ assertEquals("validation", ue.getErrorCategory());
+ assertEquals(123, ue.getErrorCode());
+ }
+ }
+
+ private static void fail(String s) throws Exception
+ {
+ throw new Exception(s);
+ }
+
+ private static void assertEquals(Object exp, Object actual) throws Exception
+ {
+ if (!(exp.equals(actual)))
+ {
+ throw new Exception("Expected #" + exp + "# but was #" +
actual + "#");
+ }
+ }
+
+ private static void assertTrue(boolean actual) throws Exception
+ {
+ if (!(actual))
+ {
+ throw new Exception("Expected true");
+ }
+ }
+
+ @Override
+ public void setTargetEndpoint(String address)
+ {
+ targetEndpoint = address;
+ }
+}
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/exception/server/EndpointImpl.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/exception/server/EndpointImpl.java 2013-07-11
12:37:03 UTC (rev 17767)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/exception/server/EndpointImpl.java 2013-07-11
16:19:17 UTC (rev 17768)
@@ -21,7 +21,7 @@
*/
package org.jboss.test.ws.jaxws.samples.exception.server;
-import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPConstants;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPFactory;
import javax.xml.soap.SOAPFault;
@@ -40,7 +40,7 @@
try
{
SOAPFactory factory = SOAPFactory.newInstance();
- SOAPFault fault = factory.createFault("this is a fault string!", new
QName("http://foo", "FooCode"));
+ SOAPFault fault = factory.createFault("this is a fault string!",
SOAPConstants.SOAP_VERSIONMISMATCH_FAULT);
fault.setFaultActor("mr.actor");
fault.addDetail().addChildElement("test");
throw new SOAPFaultException(fault);
Added:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/exception/server/SOAP12EndpointImpl.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/exception/server/SOAP12EndpointImpl.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/exception/server/SOAP12EndpointImpl.java 2013-07-11
16:19:17 UTC (rev 17768)
@@ -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.samples.exception.server;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPConstants;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPFactory;
+import javax.xml.soap.SOAPFault;
+import javax.xml.ws.soap.SOAPFaultException;
+
+public class SOAP12EndpointImpl extends EndpointImpl
+{
+ public void throwSoapFaultException()
+ {
+ // This should be thrown as-is
+ try
+ {
+ SOAPFactory factory = SOAPFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
+ SOAPFault fault = factory.createFault("this is a fault string!",
SOAPConstants.SOAP_VERSIONMISMATCH_FAULT);
+ fault.setFaultActor("mr.actor");
+ fault.appendFaultSubcode(new
QName("http://ws.gss.redhat.com/",
"NullPointerException"));
+ fault.addDetail().addChildElement("test");
+ throw new SOAPFaultException(fault);
+ }
+ catch (SOAPException s)
+ {
+ throw new RuntimeException(s);
+ }
+ }
+}
Added:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/exception/server/SOAP12ExceptionEndpointEJB3Impl.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/exception/server/SOAP12ExceptionEndpointEJB3Impl.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/exception/server/SOAP12ExceptionEndpointEJB3Impl.java 2013-07-11
16:19:17 UTC (rev 17768)
@@ -0,0 +1,35 @@
+/*
+ * 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.samples.exception.server;
+
+import javax.ejb.Stateless;
+import javax.jws.WebService;
+import javax.xml.ws.BindingType;
+import javax.xml.ws.soap.SOAPBinding;
+
+@Stateless
+@WebService(endpointInterface =
"org.jboss.test.ws.jaxws.samples.exception.server.ExceptionEndpoint")
+(a)BindingType(SOAPBinding.SOAP12HTTP_BINDING)
+public class SOAP12ExceptionEndpointEJB3Impl extends SOAP12EndpointImpl implements
ExceptionEndpoint
+{
+
+}
Added:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/exception/server/SOAP12ExceptionEndpointImpl.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/exception/server/SOAP12ExceptionEndpointImpl.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/exception/server/SOAP12ExceptionEndpointImpl.java 2013-07-11
16:19:17 UTC (rev 17768)
@@ -0,0 +1,33 @@
+/*
+ * 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.samples.exception.server;
+
+import javax.jws.WebService;
+import javax.xml.ws.BindingType;
+import javax.xml.ws.soap.SOAPBinding;
+
+@WebService(endpointInterface =
"org.jboss.test.ws.jaxws.samples.exception.server.ExceptionEndpoint")
+(a)BindingType(SOAPBinding.SOAP12HTTP_BINDING)
+public class SOAP12ExceptionEndpointImpl extends SOAP12EndpointImpl implements
ExceptionEndpoint
+{
+
+}
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/samples/exception/WEB-INF/web.xml
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/samples/exception/WEB-INF/web.xml 2013-07-11
12:37:03 UTC (rev 17767)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/samples/exception/WEB-INF/web.xml 2013-07-11
16:19:17 UTC (rev 17768)
@@ -9,9 +9,17 @@
<servlet-name>ExceptionEndpointService</servlet-name>
<servlet-class>org.jboss.test.ws.jaxws.samples.exception.server.ExceptionEndpointImpl</servlet-class>
</servlet>
+ <servlet>
+ <servlet-name>SOAP12ExceptionEndpointService</servlet-name>
+
<servlet-class>org.jboss.test.ws.jaxws.samples.exception.server.SOAP12ExceptionEndpointImpl</servlet-class>
+ </servlet>
<servlet-mapping>
<servlet-name>ExceptionEndpointService</servlet-name>
<url-pattern>/ExceptionEndpointService</url-pattern>
</servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>SOAP12ExceptionEndpointService</servlet-name>
+ <url-pattern>/SOAP12ExceptionEndpointService</url-pattern>
+ </servlet-mapping>
</web-app>