Author: richard.opalka(a)jboss.com
Date: 2010-05-17 10:01:00 -0400 (Mon, 17 May 2010)
New Revision: 12243
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/ClientSOAPHandler.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/JBWS3027TestCase.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/common/
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/common/TestConstants.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/generated/
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/generated/AddNumbers2.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/generated/AddNumbers2Response.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/generated/AddNumbersPortType.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/generated/AddNumbersPortType_handler.xml
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/generated/AddNumbersService.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/generated/AddNumbersService_handler.xml
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/generated/ObjectFactory.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/generated/package-info.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/service/
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/service/AddNumbersImpl.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/service/ServerSOAPHandler.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/service/server-handler.xml
framework/trunk/testsuite/test/resources/jaxws/jbws3027/
framework/trunk/testsuite/test/resources/jaxws/jbws3027/WEB-INF/
framework/trunk/testsuite/test/resources/jaxws/jbws3027/WEB-INF/jboss-web.xml
framework/trunk/testsuite/test/resources/jaxws/jbws3027/WEB-INF/web.xml
framework/trunk/testsuite/test/resources/jaxws/jbws3027/WEB-INF/wsdl/
framework/trunk/testsuite/test/resources/jaxws/jbws3027/WEB-INF/wsdl/AddNumbersService.wsdl
framework/trunk/testsuite/test/resources/jaxws/jbws3027/customfile.xml
Modified:
framework/trunk/testsuite/test/ant-import/build-jars-jaxws.xml
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/common/JAXWS_Util.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3022/JBWS3022TestCase.java
Log:
[JBWS-3027] providing test case
Modified: framework/trunk/testsuite/test/ant-import/build-jars-jaxws.xml
===================================================================
--- framework/trunk/testsuite/test/ant-import/build-jars-jaxws.xml 2010-05-17 13:09:03 UTC
(rev 12242)
+++ framework/trunk/testsuite/test/ant-import/build-jars-jaxws.xml 2010-05-17 14:01:00 UTC
(rev 12243)
@@ -949,6 +949,20 @@
</webinf>
</war>
+ <!-- jaxws-jbws3027 -->
+ <war warfile="${tests.output.dir}/test-libs/jaxws-jbws3027.war"
webxml="${tests.output.dir}/test-resources/jaxws/jbws3027/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/jbws3027/service/*.class"/>
+ <include name="org/jboss/test/ws/jaxws/jbws3027/service/*.xml" />
+ <include name="org/jboss/test/ws/jaxws/jbws3027/common/*.class"/>
+ <include name="org/jboss/test/ws/jaxws/common/*.class"/>
+ </classes>
+ <webinf
dir="${tests.output.dir}/test-resources/jaxws/jbws3027/WEB-INF">
+ <include name="wsdl/**" />
+ <include name="jboss-web.xml"/>
+ </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">
<classes dir="${tests.output.dir}/test-classes">
Modified:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/common/JAXWS_Util.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/common/JAXWS_Util.java 2010-05-17
13:09:03 UTC (rev 12242)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/common/JAXWS_Util.java 2010-05-17
14:01:00 UTC (rev 12243)
@@ -27,6 +27,7 @@
import java.io.StringReader;
import java.io.StringWriter;
import java.io.Writer;
+import java.util.Map;
import org.jboss.logging.Logger;
import org.jboss.wsf.common.DOMUtils;
@@ -48,6 +49,8 @@
import javax.xml.transform.sax.SAXSource;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Dispatch;
public final class JAXWS_Util
{
@@ -184,4 +187,24 @@
}
return msg;
}
+
+ public static void setSOAPACTIONURI(Object o, String action)
+ {
+ BindingProvider bp = (BindingProvider) o;
+ Map<String, Object> requestContext = bp.getRequestContext();
+ if (requestContext == null)
+ {
+ log.error("setSOAPACTIONURI:getRequestContext() returned null");
+ throw new IllegalStateException();
+ }
+ else
+ {
+ requestContext.put(BindingProvider.SOAPACTION_URI_PROPERTY, action);
+ requestContext.put(BindingProvider.SOAPACTION_USE_PROPERTY, true);
+ log.debug("SOAPACTION_USE_PROPERTY being set to: "
+ + requestContext.get(BindingProvider.SOAPACTION_USE_PROPERTY));
+ log.debug("SOAPACTION_URI_PROPERTY being set to: "
+ + requestContext.get(BindingProvider.SOAPACTION_URI_PROPERTY));
+ }
+ }
}
Modified:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3022/JBWS3022TestCase.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3022/JBWS3022TestCase.java 2010-05-17
13:09:03 UTC (rev 12242)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3022/JBWS3022TestCase.java 2010-05-17
14:01:00 UTC (rev 12243)
@@ -233,8 +233,8 @@
}
catch (SOAPFaultException e)
{
- assertFaultCode(e, true);
- assertProblemHeaderQName(e);
+ this.assertFaultCode(e, true);
+ this.assertProblemHeaderQName(e);
}
}
@@ -251,8 +251,8 @@
}
catch (SOAPFaultException e)
{
- assertFaultCode(e, true);
- assertProblemHeaderQName(e);
+ this.assertFaultCode(e, true);
+ this.assertProblemHeaderQName(e);
}
}
@@ -269,8 +269,8 @@
}
catch (SOAPFaultException e)
{
- assertFaultCode(e, false);
- assertProblemHeaderQName(e);
+ this.assertFaultCode(e, false);
+ this.assertProblemHeaderQName(e);
}
}
@@ -287,12 +287,12 @@
}
catch (SOAPFaultException e)
{
- assertFaultCode(e, false);
- assertProblemHeaderQName(e);
+ this.assertFaultCode(e, false);
+ this.assertProblemHeaderQName(e);
}
}
- private static void assertProblemHeaderQName(final SOAPFaultException exception)
throws SOAPException
+ private void assertProblemHeaderQName(final SOAPFaultException exception) throws
SOAPException
{
String faultdetail[] = WsaSOAPUtils.getFaultDetail(exception);
if (faultdetail != null)
@@ -303,7 +303,7 @@
}
}
- private static void assertFaultCode(final SOAPFaultException exception, final boolean
anonymous)
+ private void assertFaultCode(final SOAPFaultException exception, final boolean
anonymous)
throws SOAPException
{
final String faultCode = WsaSOAPUtils.getFaultCode(exception);
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/ClientSOAPHandler.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/ClientSOAPHandler.java
(rev 0)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/ClientSOAPHandler.java 2010-05-17
14:01:00 UTC (rev 12243)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.jbws3027;
+
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Map;
+import java.util.Vector;
+
+import javax.xml.soap.SOAPException;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.MessageContext.Scope;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+
+import org.jboss.test.ws.jaxws.common.AddressingHeaderException;
+import org.jboss.test.ws.jaxws.common.WsaBaseSOAPHandler;
+import org.jboss.test.ws.jaxws.jbws3027.common.TestConstants;
+
+public class ClientSOAPHandler extends WsaBaseSOAPHandler
+{
+ protected void checkInboundAction(SOAPMessageContext context, String oper, String
action)
+ {
+ if (oper.equals("addNumbers2"))
+ {
+ if (!action.equals(TestConstants.ADD_NUMBERS2_OUT_ACTION))
+ {
+ throw new AddressingHeaderException("Expected:" +
TestConstants.ADD_NUMBERS2_OUT_ACTION + ", Actual:"
+ + action);
+ }
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ protected void processOutboundMessage(SOAPMessageContext context, String oper, String
testName)
+ {
+ if (testName != null && testName.equals("actionMismatch"))
+ {
+ Map<String, List<String>> headers = (Map<String,
List<String>>) context
+ .get(MessageContext.HTTP_REQUEST_HEADERS);
+ if (headers == null)
+ headers = new Hashtable<String, List<String>>();
+ List<String> values = new Vector<String>();
+ values.add("ActionNotSupported");
+ headers.put("Soapaction", values);
+ context.put(MessageContext.HTTP_REQUEST_HEADERS, headers);
+ context.setScope(MessageContext.HTTP_REQUEST_HEADERS, Scope.APPLICATION);
+ }
+ }
+
+ protected String getAction(SOAPMessageContext context) throws SOAPException
+ {
+ String testName = (String) context.get("test.name");
+ if (testName == null)
+ return super.getAction(context);
+ else if (!testName.equals("missingActionHeader"))
+ return super.getAction(context);
+ else
+ return null;
+ }
+
+ protected String whichHandler()
+ {
+ return "ClientSOAPHandler";
+ }
+}
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/JBWS3027TestCase.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/JBWS3027TestCase.java
(rev 0)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/JBWS3027TestCase.java 2010-05-17
14:01:00 UTC (rev 12243)
@@ -0,0 +1,216 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.jbws3027;
+
+import java.net.URL;
+import java.text.MessageFormat;
+import java.util.UUID;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.Dispatch;
+import javax.xml.ws.soap.AddressingFeature;
+import javax.xml.ws.soap.SOAPFaultException;
+
+import junit.framework.Test;
+
+import org.jboss.test.ws.jaxws.common.JAXWS_Util;
+import org.jboss.test.ws.jaxws.common.WsaSOAPUtils;
+import org.jboss.test.ws.jaxws.jbws3027.generated.AddNumbersPortType;
+import org.jboss.test.ws.jaxws.jbws3027.generated.AddNumbersService;
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * [JBWS-3022] Throw RuntimeExceptions not Protocol exceptions in Addressing Handler.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public class JBWS3027TestCase extends JBossWSTest
+{
+
+ private static final String actionMismatch = "<?xml version=\"1.0\"
?><S:Envelope
xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><S:...
xmlns=\"http://www.w3.org/2005/08/addressing\">{0}</To>...
xmlns=\"http://www.w3.org/2005/08/addressing\">inputAction&l...
xmlns=\"http://www.w3.org/2005/08/addressing\">uuid:{1}</...
xmlns=\"http://www.w3.org/2005/08/addressing\"><Address&g...
xmlns:ns1=\"http://example.com\"><number1>10</number1><number2>10</number2><testName>actionMismatch</testName></ns1:addNumbers2></S:Body></S:Envelope>";
+
+ private static final String actionNotSupported = "<?xml
version=\"1.0\" ?><S:Envelope
xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><S:...
xmlns=\"http://www.w3.org/2005/08/addressing\">{0}</To>...
xmlns=\"http://www.w3.org/2005/08/addressing\">ActionNotSupp...
xmlns=\"http://www.w3.org/2005/08/addressing\">uuid:{1}</...
xmlns=\"http://www.w3.org/2005/08/addressing\"><Address&g...
xmlns:ns1=\"http://example.com\"><number1>10</number1><number2>10</number2><testName>actionNotSupported</testName></ns1:addNumbers2></S:Body></S:Envelope>";
+
+ private static final String missingActionHeader = "<?xml
version=\"1.0\" ?><S:Envelope
xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><S:...
xmlns=\"http://www.w3.org/2005/08/addressing\">{0}</To>...
xmlns=\"http://www.w3.org/2005/08/addressing\">uuid:{1}</...
xmlns=\"http://www.w3.org/2005/08/addressing\"><Address&g...
xmlns:ns1=\"http://example.com\"><number1>10</number1><number2>10</number2><testName>missingActionHeader</testName></ns1:addNumbers2></S:Body></S:Envelope>";
+
+ private static AddressingFeature DISABLED_ADDRESSING_FEATURE = new
AddressingFeature(false);
+
+ private QName PORT_QNAME = new QName("http://example.com",
"AddNumbersPort");
+
+ private String endpointURL;
+
+ private URL wsdlURL;
+
+ private AddNumbersPortType port;
+
+ private AddNumbersService service;
+
+ private Dispatch<SOAPMessage> createDispatchSOAPMessage(QName port) throws
Exception
+ {
+ return service.createDispatch(port, SOAPMessage.class,
javax.xml.ws.Service.Mode.MESSAGE,
+ DISABLED_ADDRESSING_FEATURE);
+ }
+
+ public static Test suite()
+ {
+ return new JBossWSTestSetup(JBWS3027TestCase.class,
"jaxws-jbws3027.war");
+ }
+
+ protected void setUp() throws Exception
+ {
+ endpointURL = "http://" + getServerHost() +
":8080/jaxws-jbws3027/Endpoint";
+ wsdlURL = new URL(endpointURL + "?wsdl");
+ service = new AddNumbersService(wsdlURL);
+ port = (AddNumbersPortType) service.getPort(PORT_QNAME, AddNumbersPortType.class);
+ }
+
+ public void testDefaultRequestResponseAction() throws Exception
+ {
+ int number = port.addNumbers2(10, 10,
"testDefaultRequestResponseAction");
+ log.debug("number=" + number);
+ }
+
+ public void testExplicitRequestResponseAction() throws Exception
+ {
+ int number = port.addNumbers2(10, 10,
"testExplicitRequestResponseAction");
+ log.debug("number=" + number);
+ }
+
+ public void testMessageAddressingHeaderRequiredFault() throws Exception
+ {
+ try
+ {
+ String soapMsg = MessageFormat.format(missingActionHeader, endpointURL,
UUID.randomUUID(), WsaSOAPUtils
+ .getAddrVerAnonUri());
+ Dispatch<SOAPMessage> dispatchSM = createDispatchSOAPMessage(PORT_QNAME);
+ SOAPMessage request = JAXWS_Util.makeSOAPMessage(soapMsg);
+ dispatchSM.invoke(request);
+ fail();
+ }
+ catch (SOAPFaultException e)
+ {
+ this.assertMessageAddressingHeaderRequiredFaultCode(e);
+ this.assertProblemHeaderQName(e);
+ }
+ }
+
+ public void testActionMismatchOrActionNotSupportedFaultCase1() throws Exception
+ {
+ try
+ {
+ String soapMsg = MessageFormat.format(actionMismatch, endpointURL,
UUID.randomUUID(), WsaSOAPUtils
+ .getAddrVerAnonUri());
+ Dispatch<SOAPMessage> dispatchSM = createDispatchSOAPMessage(PORT_QNAME);
+ JAXWS_Util.setSOAPACTIONURI(dispatchSM, "ActionMismatch");
+ SOAPMessage request = JAXWS_Util.makeSOAPMessage(soapMsg);
+ dispatchSM.invoke(request);
+ fail();
+ }
+ catch (SOAPFaultException e)
+ {
+ this.assertActionMismatchOrActionNotSupportedFaultCode(e);
+ this.assertProblemAction(e);
+ }
+ }
+
+ public void testActionMismatchOrActionNotSupportedFaultCase2() throws Exception
+ {
+ try
+ {
+ String soapMsg = MessageFormat.format(actionNotSupported, endpointURL,
UUID.randomUUID(), WsaSOAPUtils
+ .getAddrVerAnonUri());
+ Dispatch<SOAPMessage> dispatchSM = createDispatchSOAPMessage(PORT_QNAME);
+ JAXWS_Util.setSOAPACTIONURI(dispatchSM, "ActionNotSupported1");
+ SOAPMessage request = JAXWS_Util.makeSOAPMessage(soapMsg);
+ dispatchSM.invoke(request);
+ fail();
+ }
+ catch (SOAPFaultException e)
+ {
+ this.assertActionMismatchOrActionNotSupportedFaultCode(e);
+ this.assertProblemAction(e);
+ }
+ }
+
+ public void testActionMismatchOrActionNotSupportedFaultCase3() throws Exception
+ {
+ try
+ {
+ JAXWS_Util.setSOAPACTIONURI(port, "ActionNotSupported2");
+ port.addNumbers2(10, 10, "ActionNotSupported2");
+ fail();
+ }
+ catch (SOAPFaultException e)
+ {
+ this.assertActionMismatchOrActionNotSupportedFaultCode(e);
+ this.assertProblemAction(e);
+ }
+ }
+
+ private void assertActionMismatchOrActionNotSupportedFaultCode(final
SOAPFaultException e) throws SOAPException
+ {
+ final String faultCode = WsaSOAPUtils.getFaultCode(e);
+ final boolean expectedFaultCode = WsaSOAPUtils.isActionMismatchFaultCode(e)
+ || WsaSOAPUtils.isActionNotSupportedFaultCode(e);
+ final String msg = "SOAPFault contains unexpected faultcode got: " +
faultCode
+ + ", expected: ActionMismatch or ActionNotSupported";
+
+ assertTrue(msg, expectedFaultCode);
+ }
+
+ private void assertMessageAddressingHeaderRequiredFaultCode(final SOAPFaultException
e) throws SOAPException
+ {
+ final String faultcode = WsaSOAPUtils.getFaultCode(e);
+ final String msg = "SOAPFault contains unexpected faultcode got: " +
faultcode
+ + ", expected: MessageAddressingHeaderRequired";
+
+ assertTrue(msg, WsaSOAPUtils.isMessageAddressingHeaderRequiredFaultCode(e));
+ }
+
+ private void assertProblemHeaderQName(final SOAPFaultException e) throws
SOAPException
+ {
+ final String faultdetail[] = WsaSOAPUtils.getFaultDetail(e);
+
+ if (faultdetail != null)
+ {
+ final String msg = "FaultDetail contains unexpected value got: " +
faultdetail[0]
+ + ", expected: ProblemHeaderQName";
+ assertTrue(msg, WsaSOAPUtils.isProblemHeaderQNameFaultDetail(faultdetail[0]));
+ }
+ }
+
+ private void assertProblemAction(final SOAPFaultException e) throws SOAPException
+ {
+ final String faultdetail[] = WsaSOAPUtils.getFaultDetail(e);
+
+ if (faultdetail != null)
+ {
+ final String msg = "FaultDetail contains unexpected value got: " +
faultdetail[0]
+ + ", expected: ProblemAction";
+
+ assertTrue(msg, WsaSOAPUtils.isProblemActionFaultDetail(faultdetail[0]));
+ }
+ }
+}
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/common/TestConstants.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/common/TestConstants.java
(rev 0)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/common/TestConstants.java 2010-05-17
14:01:00 UTC (rev 12243)
@@ -0,0 +1,29 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.jbws3027.common;
+
+public class TestConstants
+{
+ public static final String ADD_NUMBERS2_IN_ACTION = "inputAction";
+
+ public static final String ADD_NUMBERS2_OUT_ACTION = "outputAction";
+}
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/generated/AddNumbers2.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/generated/AddNumbers2.java
(rev 0)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/generated/AddNumbers2.java 2010-05-17
14:01:00 UTC (rev 12243)
@@ -0,0 +1,123 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.jbws3027.generated;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * <p>Java class for addNumbers2 complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within
this class.
+ *
+ * <pre>
+ * <complexType name="addNumbers2">
+ * <complexContent>
+ * <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="number1"
type="{http://www.w3.org/2001/XMLSchema}int"/>
+ * <element name="number2"
type="{http://www.w3.org/2001/XMLSchema}int"/>
+ * <element name="testName"
type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "addNumbers2", propOrder =
+{"number1", "number2", "testName"})
+public class AddNumbers2
+{
+
+ protected int number1;
+
+ protected int number2;
+
+ protected String testName;
+
+ /**
+ * Gets the value of the number1 property.
+ *
+ */
+ public int getNumber1()
+ {
+ return number1;
+ }
+
+ /**
+ * Sets the value of the number1 property.
+ *
+ */
+ public void setNumber1(int value)
+ {
+ this.number1 = value;
+ }
+
+ /**
+ * Gets the value of the number2 property.
+ *
+ */
+ public int getNumber2()
+ {
+ return number2;
+ }
+
+ /**
+ * Sets the value of the number2 property.
+ *
+ */
+ public void setNumber2(int value)
+ {
+ this.number2 = value;
+ }
+
+ /**
+ * Gets the value of the testName property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getTestName()
+ {
+ return testName;
+ }
+
+ /**
+ * Sets the value of the testName property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setTestName(String value)
+ {
+ this.testName = value;
+ }
+
+}
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/generated/AddNumbers2Response.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/generated/AddNumbers2Response.java
(rev 0)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/generated/AddNumbers2Response.java 2010-05-17
14:01:00 UTC (rev 12243)
@@ -0,0 +1,75 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.jbws3027.generated;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * <p>Java class for addNumbers2Response complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within
this class.
+ *
+ * <pre>
+ * <complexType name="addNumbers2Response">
+ * <complexContent>
+ * <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="return"
type="{http://www.w3.org/2001/XMLSchema}int"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "addNumbers2Response", propOrder =
+{"_return"})
+public class AddNumbers2Response
+{
+
+ @XmlElement(name = "return")
+ protected int _return;
+
+ /**
+ * Gets the value of the return property.
+ *
+ */
+ public int getReturn()
+ {
+ return _return;
+ }
+
+ /**
+ * Sets the value of the return property.
+ *
+ */
+ public void setReturn(int value)
+ {
+ this._return = value;
+ }
+
+}
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/generated/AddNumbersPortType.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/generated/AddNumbersPortType.java
(rev 0)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/generated/AddNumbersPortType.java 2010-05-17
14:01:00 UTC (rev 12243)
@@ -0,0 +1,64 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.jbws3027.generated;
+
+import javax.jws.HandlerChain;
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.xml.bind.annotation.XmlSeeAlso;
+import javax.xml.ws.Action;
+import javax.xml.ws.RequestWrapper;
+import javax.xml.ws.ResponseWrapper;
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.2-12/14/2009 02:16 PM(ramkris)-
+ * Generated source version: 2.2
+ *
+ */
+@WebService(name = "AddNumbersPortType", targetNamespace =
"http://example.com")
+@HandlerChain(file = "AddNumbersPortType_handler.xml")
+@XmlSeeAlso(
+{ObjectFactory.class})
+public interface AddNumbersPortType
+{
+
+ /**
+ *
+ * @param number2
+ * @param testName
+ * @param number1
+ * @return
+ * returns int
+ */
+ @WebMethod
+ @WebResult(targetNamespace = "")
+ @RequestWrapper(localName = "addNumbers2", targetNamespace =
"http://example.com", className =
"org.jboss.test.ws.jaxws.jbws3027.generated.AddNumbers2")
+ @ResponseWrapper(localName = "addNumbers2Response", targetNamespace =
"http://example.com", className =
"org.jboss.test.ws.jaxws.jbws3027.generated.AddNumbers2Response")
+ @Action(input = "inputAction", output = "outputAction")
+ public int addNumbers2(@WebParam(name = "number1", targetNamespace =
"") int number1,
+ @WebParam(name = "number2", targetNamespace = "") int
number2,
+ @WebParam(name = "testName", targetNamespace = "") String
testName);
+
+}
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/generated/AddNumbersPortType_handler.xml
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/generated/AddNumbersPortType_handler.xml
(rev 0)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/generated/AddNumbersPortType_handler.xml 2010-05-17
14:01:00 UTC (rev 12243)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?><javaee:handler-chains
xmlns:javaee="http://java.sun.com/xml/ns/javaee">
+ <javaee:handler-chain>
+ <javaee:port-name-pattern
xmlns:ns2="http://example.com">ns2:AddNumbersPort</javaee:port-name-pattern>
+ <javaee:handler>
+ <javaee:handler-name>ClientSOAPHandler</javaee:handler-name>
+
<javaee:handler-class>org.jboss.test.ws.jaxws.jbws3027.ClientSOAPHandler</javaee:handler-class>
+ </javaee:handler>
+ </javaee:handler-chain>
+</javaee:handler-chains>
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/generated/AddNumbersService.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/generated/AddNumbersService.java
(rev 0)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/generated/AddNumbersService.java 2010-05-17
14:01:00 UTC (rev 12243)
@@ -0,0 +1,132 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.jbws3027.generated;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import javax.jws.HandlerChain;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebEndpoint;
+import javax.xml.ws.WebServiceClient;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.WebServiceFeature;
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.2-12/14/2009 02:16 PM(ramkris)-
+ * Generated source version: 2.2
+ *
+ */
+@WebServiceClient(name = "AddNumbersService", targetNamespace =
"http://example.com", wsdlLocation =
"file:/opt/svn/jbossas/tags/6.0.0.20100429-M3/build/target/jboss-6.0.0.20100429-M3/bin/AddNumbersService.wsdl")
+@HandlerChain(file = "AddNumbersService_handler.xml")
+public class AddNumbersService extends Service
+{
+
+ private final static URL ADDNUMBERSSERVICE_WSDL_LOCATION;
+
+ private final static WebServiceException ADDNUMBERSSERVICE_EXCEPTION;
+
+ private final static QName ADDNUMBERSSERVICE_QNAME = new
QName("http://example.com", "AddNumbersService");
+
+ static
+ {
+ URL url = null;
+ WebServiceException e = null;
+ try
+ {
+ url = new URL(
+
"file:/opt/svn/jbossas/tags/6.0.0.20100429-M3/build/target/jboss-6.0.0.20100429-M3/bin/AddNumbersService.wsdl");
+ }
+ catch (MalformedURLException ex)
+ {
+ e = new WebServiceException(ex);
+ }
+ ADDNUMBERSSERVICE_WSDL_LOCATION = url;
+ ADDNUMBERSSERVICE_EXCEPTION = e;
+ }
+
+ public AddNumbersService()
+ {
+ super(__getWsdlLocation(), ADDNUMBERSSERVICE_QNAME);
+ }
+
+ public AddNumbersService(WebServiceFeature... features)
+ {
+ super(__getWsdlLocation(), ADDNUMBERSSERVICE_QNAME, features);
+ }
+
+ public AddNumbersService(URL wsdlLocation)
+ {
+ super(wsdlLocation, ADDNUMBERSSERVICE_QNAME);
+ }
+
+ public AddNumbersService(URL wsdlLocation, WebServiceFeature... features)
+ {
+ super(wsdlLocation, ADDNUMBERSSERVICE_QNAME, features);
+ }
+
+ public AddNumbersService(URL wsdlLocation, QName serviceName)
+ {
+ super(wsdlLocation, serviceName);
+ }
+
+ public AddNumbersService(URL wsdlLocation, QName serviceName, WebServiceFeature...
features)
+ {
+ super(wsdlLocation, serviceName, features);
+ }
+
+ /**
+ *
+ * @return
+ * returns AddNumbersPortType
+ */
+ @WebEndpoint(name = "AddNumbersPort")
+ public AddNumbersPortType getAddNumbersPort()
+ {
+ return super.getPort(new QName("http://example.com",
"AddNumbersPort"), AddNumbersPortType.class);
+ }
+
+ /**
+ *
+ * @param features
+ * A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy.
Supported features not in the <code>features</code> parameter will have their
default values.
+ * @return
+ * returns AddNumbersPortType
+ */
+ @WebEndpoint(name = "AddNumbersPort")
+ public AddNumbersPortType getAddNumbersPort(WebServiceFeature... features)
+ {
+ return super.getPort(new QName("http://example.com",
"AddNumbersPort"), AddNumbersPortType.class, features);
+ }
+
+ private static URL __getWsdlLocation()
+ {
+ if (ADDNUMBERSSERVICE_EXCEPTION != null)
+ {
+ throw ADDNUMBERSSERVICE_EXCEPTION;
+ }
+ return ADDNUMBERSSERVICE_WSDL_LOCATION;
+ }
+
+}
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/generated/AddNumbersService_handler.xml
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/generated/AddNumbersService_handler.xml
(rev 0)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/generated/AddNumbersService_handler.xml 2010-05-17
14:01:00 UTC (rev 12243)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?><javaee:handler-chains
xmlns:javaee="http://java.sun.com/xml/ns/javaee">
+ <javaee:handler-chain>
+ <javaee:port-name-pattern
xmlns:ns2="http://example.com">ns2:AddNumbersPort</javaee:port-name-pattern>
+ <javaee:handler>
+ <javaee:handler-name>ClientSOAPHandler</javaee:handler-name>
+
<javaee:handler-class>org.jboss.test.ws.jaxws.jbws3027.ClientSOAPHandler</javaee:handler-class>
+ </javaee:handler>
+ </javaee:handler-chain>
+</javaee:handler-chains>
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/generated/ObjectFactory.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/generated/ObjectFactory.java
(rev 0)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/generated/ObjectFactory.java 2010-05-17
14:01:00 UTC (rev 12243)
@@ -0,0 +1,97 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.jbws3027.generated;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.annotation.XmlElementDecl;
+import javax.xml.bind.annotation.XmlRegistry;
+import javax.xml.namespace.QName;
+
+/**
+ * This object contains factory methods for each
+ * Java content interface and Java element interface
+ * generated in the org.jboss.test.ws.jaxws.jbws3027.generated package.
+ * <p>An ObjectFactory allows you to programatically
+ * construct new instances of the Java representation
+ * for XML content. The Java representation of XML
+ * content can consist of schema derived interfaces
+ * and classes representing the binding of schema
+ * type definitions, element declarations and model
+ * groups. Factory methods for each of these are
+ * provided in this class.
+ *
+ */
+@XmlRegistry
+public class ObjectFactory
+{
+
+ private final static QName _AddNumbers2_QNAME = new
QName("http://example.com", "addNumbers2");
+
+ private final static QName _AddNumbers2Response_QNAME = new
QName("http://example.com", "addNumbers2Response");
+
+ /**
+ * Create a new ObjectFactory that can be used to create new instances of schema
derived classes for package: org.jboss.test.ws.jaxws.jbws3027.generated
+ *
+ */
+ public ObjectFactory()
+ {
+ }
+
+ /**
+ * Create an instance of {@link AddNumbers2 }
+ *
+ */
+ public AddNumbers2 createAddNumbers2()
+ {
+ return new AddNumbers2();
+ }
+
+ /**
+ * Create an instance of {@link AddNumbers2Response }
+ *
+ */
+ public AddNumbers2Response createAddNumbers2Response()
+ {
+ return new AddNumbers2Response();
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link AddNumbers2 }{@code
>}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://example.com", name =
"addNumbers2")
+ public JAXBElement<AddNumbers2> createAddNumbers2(AddNumbers2 value)
+ {
+ return new JAXBElement<AddNumbers2>(_AddNumbers2_QNAME, AddNumbers2.class,
null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link AddNumbers2Response
}{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://example.com", name =
"addNumbers2Response")
+ public JAXBElement<AddNumbers2Response>
createAddNumbers2Response(AddNumbers2Response value)
+ {
+ return new JAXBElement<AddNumbers2Response>(_AddNumbers2Response_QNAME,
AddNumbers2Response.class, null, value);
+ }
+
+}
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/generated/package-info.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/generated/package-info.java
(rev 0)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/generated/package-info.java 2010-05-17
14:01:00 UTC (rev 12243)
@@ -0,0 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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://example.com")
+package org.jboss.test.ws.jaxws.jbws3027.generated;
+
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/service/AddNumbersImpl.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/service/AddNumbersImpl.java
(rev 0)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/service/AddNumbersImpl.java 2010-05-17
14:01:00 UTC (rev 12243)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.jbws3027.service;
+
+import javax.jws.HandlerChain;
+import javax.jws.WebParam;
+import javax.jws.WebService;
+import javax.xml.ws.Action;
+import javax.xml.ws.soap.Addressing;
+
+import org.jboss.test.ws.jaxws.common.AddressingHeaderException;
+
+@WebService(name = "AddNumbersPortType", portName = "AddNumbersPort",
serviceName = "AddNumbersService", targetNamespace =
"http://example.com", wsdlLocation =
"WEB-INF/wsdl/AddNumbersService.wsdl")
+@HandlerChain(file = "server-handler.xml")
+@Addressing(enabled = true, required = true)
+public class AddNumbersImpl
+{
+
+ @Action(input = "inputAction", output = "outputAction")
+ public int addNumbers2(@WebParam(name = "number1") int number1,
@WebParam(name = "number2") int number2,
+ @WebParam(name = "testName") String testName)
+ {
+ if (number1 < 0 || number2 < 0)
+ {
+ throw new AddressingHeaderException("One of the numbers received was
negative:" + number1 + ", " + number2);
+ }
+ System.out.printf("Adding %s and %s\n", number1, number2);
+ return number1 + number2;
+ }
+}
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/service/ServerSOAPHandler.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/service/ServerSOAPHandler.java
(rev 0)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/service/ServerSOAPHandler.java 2010-05-17
14:01:00 UTC (rev 12243)
@@ -0,0 +1,94 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.jbws3027.service;
+
+import javax.xml.soap.SOAPException;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+
+import org.jboss.test.ws.jaxws.common.AddressingHeaderException;
+import org.jboss.test.ws.jaxws.common.AddressingPropertyException;
+import org.jboss.test.ws.jaxws.common.WsaBaseSOAPHandler;
+import org.jboss.test.ws.jaxws.jbws3027.common.TestConstants;
+
+public class ServerSOAPHandler extends WsaBaseSOAPHandler
+{
+ protected void checkInboundAction(SOAPMessageContext context, String oper, String
action)
+ {
+ if (oper.equals("addNumbers2"))
+ {
+ if (action == null)
+ return;
+ if (action.equals("ActionNotSupported") ||
action.equals("ActionNotSupported2"))
+ return;
+ if (!action.equals(TestConstants.ADD_NUMBERS2_IN_ACTION))
+ {
+ throw new AddressingHeaderException("Expected:" +
TestConstants.ADD_NUMBERS2_IN_ACTION + ", Actual:"
+ + action);
+ }
+ }
+ }
+
+ protected void checkInboundReplyTo(SOAPMessageContext context)
+ {
+ String replyTo = null;
+ try
+ {
+ replyTo = getReplyTo(context);
+ }
+ catch (Exception e)
+ {
+ String testName = (String) context.get("test.name");
+ if (testName.equals("missingReplyToHeader"))
+ return;
+ throw new WebServiceException(e);
+ }
+ if (replyTo == null)
+ {
+ throw new AddressingPropertyException("wsa:ReplyTo contains null");
+ }
+ if (replyTo.equals("invalid"))
+ {
+ throw new AddressingPropertyException("wsa:ReplyTo contains invalid
value");
+ }
+ if (replyTo.equals(""))
+ {
+ throw new AddressingPropertyException("wsa:ReplyTo contains an empty
value");
+ }
+ }
+
+ protected String getAction(SOAPMessageContext context) throws SOAPException
+ {
+ String testName = (String) context.get("test.name");
+ if (testName == null)
+ return super.getAction(context);
+ else if (!testName.equals("missingActionHeader"))
+ return super.getAction(context);
+ else
+ return null;
+ }
+
+ protected String whichHandler()
+ {
+ return "ServerSOAPHandler";
+ }
+}
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/service/server-handler.xml
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/service/server-handler.xml
(rev 0)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3027/service/server-handler.xml 2010-05-17
14:01:00 UTC (rev 12243)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<handler-chains
xmlns="http://java.sun.com/xml/ns/javaee">
+ <handler-chain>
+ <handler>
+ <handler-name>ServerSOAPHandler</handler-name>
+
<handler-class>org.jboss.test.ws.jaxws.jbws3027.service.ServerSOAPHandler</handler-class>
+ </handler>
+ </handler-chain>
+</handler-chains>
Added: framework/trunk/testsuite/test/resources/jaxws/jbws3027/WEB-INF/jboss-web.xml
===================================================================
--- framework/trunk/testsuite/test/resources/jaxws/jbws3027/WEB-INF/jboss-web.xml
(rev 0)
+++
framework/trunk/testsuite/test/resources/jaxws/jbws3027/WEB-INF/jboss-web.xml 2010-05-17
14:01:00 UTC (rev 12243)
@@ -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-jbws3027</context-root>
+</jboss-web>
\ No newline at end of file
Added: framework/trunk/testsuite/test/resources/jaxws/jbws3027/WEB-INF/web.xml
===================================================================
--- framework/trunk/testsuite/test/resources/jaxws/jbws3027/WEB-INF/web.xml
(rev 0)
+++ framework/trunk/testsuite/test/resources/jaxws/jbws3027/WEB-INF/web.xml 2010-05-17
14:01:00 UTC (rev 12243)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+
+ <display-name>Test</display-name>
+ <servlet>
+ <servlet-name>Endpoint</servlet-name>
+
<servlet-class>org.jboss.test.ws.jaxws.jbws3027.service.AddNumbersImpl</servlet-class>
+ <load-on-startup>0</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>Endpoint</servlet-name>
+ <url-pattern>/Endpoint</url-pattern>
+ </servlet-mapping>
+ <session-config>
+ <session-timeout>54</session-timeout>
+ </session-config>
+</web-app>
+
Added:
framework/trunk/testsuite/test/resources/jaxws/jbws3027/WEB-INF/wsdl/AddNumbersService.wsdl
===================================================================
---
framework/trunk/testsuite/test/resources/jaxws/jbws3027/WEB-INF/wsdl/AddNumbersService.wsdl
(rev 0)
+++
framework/trunk/testsuite/test/resources/jaxws/jbws3027/WEB-INF/wsdl/AddNumbersService.wsdl 2010-05-17
14:01:00 UTC (rev 12243)
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="AddNumbersService"
targetNamespace="http://example.com"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://example.com"
xmlns:wsa="http://www.w3.org/2007/05/addressing/metadata"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <types>
+ <xs:schema targetNamespace="http://example.com" version="1.0"
xmlns:tns="http://example.com"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
+ <xs:element name="addNumbers2" type="tns:addNumbers2"/>
+ <xs:element name="addNumbers2Response"
type="tns:addNumbers2Response"/>
+ <xs:complexType name="addNumbers2">
+ <xs:sequence>
+ <xs:element name="number1" type="xs:int"/>
+ <xs:element name="number2" type="xs:int"/>
+ <xs:element minOccurs="0" name="testName"
type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="addNumbers2Response">
+ <xs:sequence>
+ <xs:element name="return" type="xs:int"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:schema>
+ </types>
+ <message name="AddNumbersPortType_addNumbers2">
+ <part element="tns:addNumbers2" name="addNumbers2"/>
+ </message>
+ <message name="AddNumbersPortType_addNumbers2Response">
+ <part element="tns:addNumbers2Response"
name="addNumbers2Response"/>
+ </message>
+ <portType name="AddNumbersPortType">
+ <operation name="addNumbers2" parameterOrder="addNumbers2">
+ <input message="tns:AddNumbersPortType_addNumbers2"
wsa:Action="inputAction"/>
+ <output message="tns:AddNumbersPortType_addNumbers2Response"
wsa:Action="outputAction"/>
+ </operation>
+ </portType>
+ <binding name="AddNumbersPortTypeBinding"
type="tns:AddNumbersPortType">
+ <wsp:PolicyReference URI="#9748978d-7087-4151-81d5-7f16a8040d0d"
xmlns:wsp="http://www.w3.org/ns/ws-policy"/>
+ <soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="addNumbers2">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="AddNumbersService">
+ <port binding="tns:AddNumbersPortTypeBinding"
name="AddNumbersPort">
+ <soap:address
location="http://localhost:8080/jaxws-jbws3027/Endpoint"/>
+ </port>
+ </service>
+ <wsp:Policy wsu:Id="9748978d-7087-4151-81d5-7f16a8040d0d"
xmlns:wsp="http://www.w3.org/ns/ws-policy"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-w...
+ <wsam:Addressing
xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata">
+ <wsp:Policy/>
+ </wsam:Addressing>
+ </wsp:Policy>
+</definitions>
\ No newline at end of file
Added: framework/trunk/testsuite/test/resources/jaxws/jbws3027/customfile.xml
===================================================================
--- framework/trunk/testsuite/test/resources/jaxws/jbws3027/customfile.xml
(rev 0)
+++ framework/trunk/testsuite/test/resources/jaxws/jbws3027/customfile.xml 2010-05-17
14:01:00 UTC (rev 12243)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"
standalone="yes"?>
+<jaxws:bindings
+ wsdlLocation="AddNumbersService.wsdl"
+
xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
+
xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
+
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+
xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
+ <jaxws:bindings node="wsdl:definitions">
+ <jaxws:package
name="org.jboss.test.ws.jaxws.jbws3027.generated"/>
+ </jaxws:bindings>
+ <jaxws:bindings>
+ <javaee:handler-chains>
+ <javaee:handler-chain>
+ <javaee:port-name-pattern
xmlns:ns2="http://example.com">ns2:AddNumbersPort</javaee:port-name-pattern>
+ <javaee:handler>
+
<javaee:handler-name>ClientSOAPHandler</javaee:handler-name>
+
<javaee:handler-class>org.jboss.test.ws.jaxws.jbws3027.ClientSOAPHandler</javaee:handler-class>
+ </javaee:handler>
+ </javaee:handler-chain>
+ </javaee:handler-chains>
+ </jaxws:bindings>
+ <!-- JBossWS generates XML schemas inside WSDL, not in separate schema files like
Sun RI -->
+ <jaxws:bindings
node="wsdl:definitions/wsdl:types/xs:schema[@targetNamespace='http://example.com']">
+ <jaxb:schemaBindings>
+ <jaxb:package
name="org.jboss.test.ws.jaxws.jbws3027.generated"/>
+ </jaxb:schemaBindings>
+ </jaxws:bindings>
+
+</jaxws:bindings>