Author: darran.lofthouse(a)jboss.com
Date: 2009-11-29 11:18:32 -0500 (Sun, 29 Nov 2009)
New Revision: 11167
Added:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws1815/
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws1815/JBWS1815TestCase.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws1815/ProviderImpl.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws1815/
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws1815/META-INF/
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws1815/META-INF/wsdl/
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws1815/META-INF/wsdl/my-service.wsdl
Removed:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws1815/JBWS1815TestCase.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws1815/ProviderImpl.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws1815/META-INF/
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws1815/META-INF/wsdl/
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws1815/META-INF/wsdl/my-service.wsdl
Modified:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/ant-import-tests/build-jars-jaxws.xml
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/core/jaxws/SOAPFaultHelperJAXWS.java
Log:
[JBPAPP-3178] Missing fault detail in SOAPFault.
Modified:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/ant-import-tests/build-jars-jaxws.xml
===================================================================
---
stack/native/branches/jbossws-native-2.0.1.SP2_CP/ant-import-tests/build-jars-jaxws.xml 2009-11-27
22:26:16 UTC (rev 11166)
+++
stack/native/branches/jbossws-native-2.0.1.SP2_CP/ant-import-tests/build-jars-jaxws.xml 2009-11-29
16:18:32 UTC (rev 11167)
@@ -498,6 +498,16 @@
</metainf>
</jar>
+ <!-- jaxws-jbws1815 -->
+ <jar destfile="${tests.output.dir}/libs/jaxws-jbws1815.ejb3">
+ <fileset dir="${tests.output.dir}/classes">
+ <include
name="org/jboss/test/ws/jaxws/jbws1815/ProviderImpl.class"/>
+ </fileset>
+ <metainf
dir="${tests.output.dir}/resources/jaxws/jbws1815/META-INF">
+ <include name="wsdl/my-service.wsdl"/>
+ </metainf>
+ </jar>
+
<!-- jaxws-jbws1854 -->
<war destfile="${tests.output.dir}/libs/jaxws-jbws1854.war"
webxml="${tests.output.dir}/resources/jaxws/jbws1854/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/classes">
Modified:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/core/jaxws/SOAPFaultHelperJAXWS.java
===================================================================
---
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/core/jaxws/SOAPFaultHelperJAXWS.java 2009-11-27
22:26:16 UTC (rev 11166)
+++
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/core/jaxws/SOAPFaultHelperJAXWS.java 2009-11-29
16:18:32 UTC (rev 11167)
@@ -72,6 +72,10 @@
/** Factory method for FaultException for a given SOAPFault */
public static SOAPFaultException getSOAPFaultException(SOAPFault soapFault)
{
+
+ if (soapFault == null)
+ throw new IllegalArgumentException("SOAPFault cannot be null");
+
SOAPFaultException faultEx = new SOAPFaultException(soapFault);
Detail detail = soapFault.getDetail();
@@ -155,10 +159,20 @@
try
{
SOAPMessageImpl faultMessage;
+ Throwable cause = reqEx.getCause();
if (reqEx instanceof SOAPFaultException)
{
faultMessage = toSOAPMessage((SOAPFaultException)reqEx);
}
+ /* JAX-WS 6.4.1: When an implementation catches an exception thrown by a
+ * service endpoint implementation and the cause of that exception is an
+ * instance of the appropriate ProtocolException subclass for the protocol
+ * in use, an implementation MUST reflect the information contained in the
+ * ProtocolException subclass within the generated protocol level fault. */
+ else if (cause != null && cause instanceof SOAPFaultException)
+ {
+ faultMessage = toSOAPMessage((SOAPFaultException)cause);
+ }
else if (reqEx instanceof CommonSOAPFaultException)
{
faultMessage = SOAPFaultHelperJAXRPC.exceptionToFaultMessage(reqEx);
@@ -237,23 +251,8 @@
SOAPMessageImpl soapMessage = createSOAPMessage();
SOAPBody soapBody = soapMessage.getSOAPBody();
- SOAPFault soapFault;
- /* JAX-WS 6.4.1: When an implementation catches an exception thrown by a
- * service endpoint implementation and the cause of that exception is an
- * instance of the appropriate ProtocolException subclass for the protocol
- * in use, an implementation MUST reflect the information contained in the
- * ProtocolException subclass within the generated protocol level fault. */
- Throwable cause = ex.getCause();
- if (cause instanceof SOAPFaultException)
- {
- populateSOAPFault(soapBody, (SOAPFaultException)cause);
- soapFault = soapBody.getFault();
- }
- else
- {
- soapFault = soapBody.addFault(getFallbackFaultCode(),
getFallbackFaultString(ex));
- }
+ SOAPFault soapFault = soapBody.addFault(getFallbackFaultCode(),
getFallbackFaultString(ex));
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
SerializationContext serContext = msgContext.getSerializationContext();
Copied:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws1815
(from rev 4738, stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1815)
Deleted:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws1815/JBWS1815TestCase.java
===================================================================
---
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1815/JBWS1815TestCase.java 2007-10-11
12:15:07 UTC (rev 4738)
+++
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws1815/JBWS1815TestCase.java 2009-11-29
16:18:32 UTC (rev 11167)
@@ -1,108 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.test.ws.jaxws.jbws1815;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.net.URL;
-
-import javax.xml.soap.Detail;
-import javax.xml.soap.MessageFactory;
-import javax.xml.soap.SOAPConnection;
-import javax.xml.soap.SOAPConnectionFactory;
-import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPEnvelope;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPMessage;
-
-import junit.framework.Test;
-
-import org.jboss.wsf.common.DOMUtils;
-import org.jboss.wsf.common.DOMWriter;
-import org.jboss.wsf.test.JBossWSTest;
-import org.jboss.wsf.test.JBossWSTestSetup;
-import org.w3c.dom.Element;
-
-/**
- * Test case for
http://jira.jboss.org/jira/browse/JBWS-1815
- *
- * @author alessio.soldano(a)jboss.com
- * @since 11-Oct-2007
- */
-public class JBWS1815TestCase extends JBossWSTest
-{
- public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() +
":8080/jaxws-jbws1815/ProviderImpl";
-
- private String msgString =
- "<soapenv:Envelope
xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"
xmlns:my=\"http://www.my-company.it/ws/my-test\">" +
- " <soapenv:Header/>" +
- " <soapenv:Body>" +
- " <my:performTest>" +
- " <my:Code>43</my:Code>" +
- " </my:performTest>" +
- " </soapenv:Body>" +
- "</soapenv:Envelope>";
-
- public static Test suite()
- {
- return new JBossWSTestSetup(JBWS1815TestCase.class,
"jaxws-jbws1815.ejb3");
- }
-
- public void testWSDLAccess() throws Exception
- {
- URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
- Element wsdl = DOMUtils.parse(wsdlURL.openStream());
- assertNotNull(wsdl);
- }
-
-
- public void testProviderMessage() throws Exception
- {
- try {
- SOAPMessage reqMsg = getRequestMessage();
- URL epURL = new URL(TARGET_ENDPOINT_ADDRESS);
- SOAPConnection con = SOAPConnectionFactory.newInstance().createConnection();
- SOAPMessage resMsg = con.call(reqMsg, epURL);
- SOAPEnvelope resEnv = resMsg.getSOAPPart().getEnvelope();
- System.out.println("response: " + DOMWriter.printNode(resEnv,
false));
- Detail detail = resEnv.getBody().getFault().getDetail();
-// assertNotNull(detail);
- SOAPElement exception = (SOAPElement)detail.getDetailEntries().next();
-// assertNotNull(exception);
-// assertEquals(exception.getNodeName(),"MyWSException");
- SOAPElement message = (SOAPElement)exception.getChildElements().next();
-// assertNotNull(message);
-// assertEquals(message.getNodeName(),"message");
-// assertEquals(message.getValue(),"This is a faked error");
- } catch (Exception e) {
- System.out.println("[FIXME] JBWS-1815: Cannot add fault detail");
- }
- }
-
- private SOAPMessage getRequestMessage() throws SOAPException, IOException
- {
- MessageFactory msgFactory = MessageFactory.newInstance();
- SOAPMessage reqMsg = msgFactory.createMessage(null, new
ByteArrayInputStream(msgString.getBytes()));
- return reqMsg;
- }
-
-}
Copied:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws1815/JBWS1815TestCase.java
(from rev 4738,
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1815/JBWS1815TestCase.java)
===================================================================
---
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws1815/JBWS1815TestCase.java
(rev 0)
+++
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws1815/JBWS1815TestCase.java 2009-11-29
16:18:32 UTC (rev 11167)
@@ -0,0 +1,102 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jbws1815;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.net.URL;
+
+import javax.xml.soap.Detail;
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.SOAPConnection;
+import javax.xml.soap.SOAPConnectionFactory;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.common.DOMUtils;
+import org.jboss.wsf.common.DOMWriter;
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+import org.w3c.dom.Element;
+
+/**
+ * Test case for
http://jira.jboss.org/jira/browse/JBWS-1815
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 11-Oct-2007
+ */
+public class JBWS1815TestCase extends JBossWSTest
+{
+ public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() +
":8080/jaxws-jbws1815/ProviderImpl";
+
+ private String msgString =
+ "<soapenv:Envelope
xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"
xmlns:my=\"http://www.my-company.it/ws/my-test\">" +
+ " <soapenv:Header/>" +
+ " <soapenv:Body>" +
+ " <my:performTest>" +
+ " <my:Code>43</my:Code>" +
+ " </my:performTest>" +
+ " </soapenv:Body>" +
+ "</soapenv:Envelope>";
+
+ public static Test suite()
+ {
+ return new JBossWSTestSetup(JBWS1815TestCase.class,
"jaxws-jbws1815.ejb3");
+ }
+
+ public void testWSDLAccess() throws Exception
+ {
+ URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
+ Element wsdl = DOMUtils.parse(wsdlURL.openStream());
+ assertNotNull(wsdl);
+ }
+
+ public void testProviderMessage() throws Exception
+ {
+ SOAPMessage reqMsg = getRequestMessage();
+ URL epURL = new URL(TARGET_ENDPOINT_ADDRESS);
+ SOAPConnection con = SOAPConnectionFactory.newInstance().createConnection();
+ SOAPMessage resMsg = con.call(reqMsg, epURL);
+ SOAPEnvelope resEnv = resMsg.getSOAPPart().getEnvelope();
+ Detail detail = resEnv.getBody().getFault().getDetail();
+ assertNotNull(detail);
+ SOAPElement exception = (SOAPElement)detail.getDetailEntries().next();
+ assertNotNull(exception);
+ assertEquals(exception.getNodeName(), "MyWSException");
+ SOAPElement message = (SOAPElement)exception.getChildElements().next();
+ assertNotNull(message);
+ assertEquals(message.getNodeName(), "message");
+ assertEquals(message.getValue(), "This is a faked error");
+ }
+
+ private SOAPMessage getRequestMessage() throws SOAPException, IOException
+ {
+ MessageFactory msgFactory = MessageFactory.newInstance();
+ SOAPMessage reqMsg = msgFactory.createMessage(null, new
ByteArrayInputStream(msgString.getBytes()));
+ return reqMsg;
+ }
+
+}
Deleted:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws1815/ProviderImpl.java
===================================================================
---
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1815/ProviderImpl.java 2007-10-11
12:15:07 UTC (rev 4738)
+++
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws1815/ProviderImpl.java 2009-11-29
16:18:32 UTC (rev 11167)
@@ -1,74 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.test.ws.jaxws.jbws1815;
-
-import javax.ejb.Local;
-import javax.ejb.Stateless;
-import javax.xml.namespace.QName;
-import javax.xml.soap.Detail;
-import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPFactory;
-import javax.xml.soap.SOAPFault;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.ws.Provider;
-import javax.xml.ws.Service;
-import javax.xml.ws.ServiceMode;
-import javax.xml.ws.WebServiceProvider;
-import javax.xml.ws.soap.SOAPFaultException;
-
-import org.jboss.wsf.spi.annotation.WebContext;
-
-/**
- * Test impl for
http://jira.jboss.org/jira/browse/JBWS-1815
- *
- * @author alessio.soldano(a)jboss.com
- * @since 11-Oct-2007
- */
-@Local
-@Stateless
-@WebServiceProvider(serviceName = "MyTestService",
- portName = "MyTestPort",
- targetNamespace = "http://www.my-company.it/ws/my-test",
- wsdlLocation = "META-INF/wsdl/my-service.wsdl")
-@WebContext(contextRoot = "/jaxws-jbws1815")
-@ServiceMode(value = Service.Mode.MESSAGE)
-public class ProviderImpl implements Provider<SOAPMessage>
-{
-
- public SOAPMessage invoke(SOAPMessage requestSoapMessage)
- {
- SOAPFault theSOAPFault;
- try {
- theSOAPFault = SOAPFactory.newInstance().createFault();
- Detail soapFaultDetail = theSOAPFault.addDetail();
- SOAPElement myFaultElement = soapFaultDetail.addChildElement(new
QName("http://www.my-company.it/ws/my-test", "MyWSException"));
- SOAPElement myMessageElement = myFaultElement.addChildElement(new
QName("http://www.my-company.it/ws/my-test", "message"));
-// myMessageElement.setNodeValue("This is a faked error"); //wrong:
myMessageElement is not a text node
- myMessageElement.setValue("This is a faked error"); //right: this
creates a text node and gives it a text value
- } catch (SOAPException se) {
- se.printStackTrace();
- throw new RuntimeException("Something unexpected happened!");
- }
- throw new SOAPFaultException(theSOAPFault);
- }
-}
Copied:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws1815/ProviderImpl.java
(from rev 4738,
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1815/ProviderImpl.java)
===================================================================
---
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws1815/ProviderImpl.java
(rev 0)
+++
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbws1815/ProviderImpl.java 2009-11-29
16:18:32 UTC (rev 11167)
@@ -0,0 +1,74 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jbws1815;
+
+import javax.ejb.Local;
+import javax.ejb.Stateless;
+import javax.xml.namespace.QName;
+import javax.xml.soap.Detail;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPFactory;
+import javax.xml.soap.SOAPFault;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.Provider;
+import javax.xml.ws.Service;
+import javax.xml.ws.ServiceMode;
+import javax.xml.ws.WebServiceProvider;
+import javax.xml.ws.soap.SOAPFaultException;
+
+import org.jboss.wsf.spi.annotation.WebContext;
+
+/**
+ * Test impl for
http://jira.jboss.org/jira/browse/JBWS-1815
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 11-Oct-2007
+ */
+@Local
+@Stateless
+@WebServiceProvider(serviceName = "MyTestService",
+ portName = "MyTestPort",
+ targetNamespace = "http://www.my-company.it/ws/my-test",
+ wsdlLocation = "META-INF/wsdl/my-service.wsdl")
+@WebContext(contextRoot = "/jaxws-jbws1815")
+@ServiceMode(value = Service.Mode.MESSAGE)
+public class ProviderImpl implements Provider<SOAPMessage>
+{
+
+ public SOAPMessage invoke(SOAPMessage requestSoapMessage)
+ {
+ SOAPFault theSOAPFault;
+ try {
+ theSOAPFault = SOAPFactory.newInstance().createFault();
+ Detail soapFaultDetail = theSOAPFault.addDetail();
+ SOAPElement myFaultElement = soapFaultDetail.addChildElement(new
QName("http://www.my-company.it/ws/my-test", "MyWSException"));
+ SOAPElement myMessageElement = myFaultElement.addChildElement(new
QName("http://www.my-company.it/ws/my-test", "message"));
+// myMessageElement.setNodeValue("This is a faked error"); //wrong:
myMessageElement is not a text node
+ myMessageElement.setValue("This is a faked error"); //right: this
creates a text node and gives it a text value
+ } catch (SOAPException se) {
+ se.printStackTrace();
+ throw new RuntimeException("Something unexpected happened!");
+ }
+ throw new SOAPFaultException(theSOAPFault);
+ }
+}
Copied:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws1815 (from
rev 4738, stack/native/trunk/src/test/resources/jaxws/jbws1815)
Copied:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws1815/META-INF
(from rev 4738, stack/native/trunk/src/test/resources/jaxws/jbws1815/META-INF)
Copied:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws1815/META-INF/wsdl
(from rev 4738, stack/native/trunk/src/test/resources/jaxws/jbws1815/META-INF/wsdl)
Deleted:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws1815/META-INF/wsdl/my-service.wsdl
===================================================================
---
stack/native/trunk/src/test/resources/jaxws/jbws1815/META-INF/wsdl/my-service.wsdl 2007-10-11
12:15:07 UTC (rev 4738)
+++
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws1815/META-INF/wsdl/my-service.wsdl 2009-11-29
16:18:32 UTC (rev 11167)
@@ -1,58 +0,0 @@
-<definitions name="MyTestService"
targetNamespace="http://www.my-company.it/ws/my-test"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://www.my-company.it/ws/my-test"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <types>
- <schema elementFormDefault="qualified"
targetNamespace="http://www.my-company.it/ws/my-test"
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="http://www.my-company.it/ws/my-test"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <complexType name="MyWSException">
- <sequence>
- <element name="message" nillable="true"
type="string"/>
- </sequence>
- </complexType>
- <complexType name="performTest">
- <sequence>
- <element name="Code" nillable="true"
type="long"/>
- </sequence>
- </complexType>
- <complexType name="performTestResponse">
- <sequence/>
- </complexType>
- <element name="MyWSException" type="tns:MyWSException"/>
- <element name="performTest" type="tns:performTest"/>
- <element name="performTestResponse"
type="tns:performTestResponse"/>
- </schema>
- </types>
- <message name="MyTest_performTestResponse">
- <part element="tns:performTestResponse" name="result"/>
- </message>
- <message name="MyTest_performTest">
- <part element="tns:performTest" name="parameters"/>
- </message>
- <message name="MyWSException">
- <part element="tns:MyWSException" name="MyWSException"/>
- </message>
- <portType name="MyTest">
- <operation name="performTest">
- <input message="tns:MyTest_performTest"/>
- <output message="tns:MyTest_performTestResponse"/>
- <fault message="tns:MyWSException" name="MyWSException"/>
- </operation>
- </portType>
- <binding name="MyTestBinding" type="tns:MyTest">
- <soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
- <operation name="performTest">
- <soap:operation soapAction="urn:performTest"/>
- <input>
- <soap:body use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- <fault name="MyWSException">
- <soap:fault name="MyWSException" use="literal"/>
- </fault>
- </operation>
- </binding>
- <service name="MyTestService">
- <port binding="tns:MyTestBinding" name="MyTestPort">
- <soap:address
location="http://my-company.it/my-context/my-endpoint"/>
- </port>
- </service>
-</definitions>
\ No newline at end of file
Copied:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws1815/META-INF/wsdl/my-service.wsdl
(from rev 4738,
stack/native/trunk/src/test/resources/jaxws/jbws1815/META-INF/wsdl/my-service.wsdl)
===================================================================
---
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws1815/META-INF/wsdl/my-service.wsdl
(rev 0)
+++
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbws1815/META-INF/wsdl/my-service.wsdl 2009-11-29
16:18:32 UTC (rev 11167)
@@ -0,0 +1,58 @@
+<definitions name="MyTestService"
targetNamespace="http://www.my-company.it/ws/my-test"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://www.my-company.it/ws/my-test"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <types>
+ <schema elementFormDefault="qualified"
targetNamespace="http://www.my-company.it/ws/my-test"
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="http://www.my-company.it/ws/my-test"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <complexType name="MyWSException">
+ <sequence>
+ <element name="message" nillable="true"
type="string"/>
+ </sequence>
+ </complexType>
+ <complexType name="performTest">
+ <sequence>
+ <element name="Code" nillable="true"
type="long"/>
+ </sequence>
+ </complexType>
+ <complexType name="performTestResponse">
+ <sequence/>
+ </complexType>
+ <element name="MyWSException" type="tns:MyWSException"/>
+ <element name="performTest" type="tns:performTest"/>
+ <element name="performTestResponse"
type="tns:performTestResponse"/>
+ </schema>
+ </types>
+ <message name="MyTest_performTestResponse">
+ <part element="tns:performTestResponse" name="result"/>
+ </message>
+ <message name="MyTest_performTest">
+ <part element="tns:performTest" name="parameters"/>
+ </message>
+ <message name="MyWSException">
+ <part element="tns:MyWSException" name="MyWSException"/>
+ </message>
+ <portType name="MyTest">
+ <operation name="performTest">
+ <input message="tns:MyTest_performTest"/>
+ <output message="tns:MyTest_performTestResponse"/>
+ <fault message="tns:MyWSException" name="MyWSException"/>
+ </operation>
+ </portType>
+ <binding name="MyTestBinding" type="tns:MyTest">
+ <soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="performTest">
+ <soap:operation soapAction="urn:performTest"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="MyWSException">
+ <soap:fault name="MyWSException" use="literal"/>
+ </fault>
+ </operation>
+ </binding>
+ <service name="MyTestService">
+ <port binding="tns:MyTestBinding" name="MyTestPort">
+ <soap:address
location="http://my-company.it/my-context/my-endpoint"/>
+ </port>
+ </service>
+</definitions>
\ No newline at end of file