Author: jim.ma
Date: 2010-03-30 02:51:46 -0400 (Tue, 30 Mar 2010)
New Revision: 11881
Added:
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2978/
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2978/AddNumbers.java
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2978/AddNumbersImpl.java
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2978/AddNumbersRequest.java
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2978/AddNumbersResponse.java
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2978/JBWS2978TestCase.java
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2978/
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2978/WEB-INF/
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2978/WEB-INF/jboss-web.xml
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2978/WEB-INF/web.xml
Modified:
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/DispatchImpl.java
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/DispatchSOAPBinding.java
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingServerHandler.java
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml
Log:
[JBPAPP-4027]:check mismatch between soap action and wsa action
Modified:
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/DispatchImpl.java
===================================================================
---
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/DispatchImpl.java 2010-03-29
06:01:11 UTC (rev 11880)
+++
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/DispatchImpl.java 2010-03-30
06:51:46 UTC (rev 11881)
@@ -191,16 +191,15 @@
// R2745 A HTTP request MESSAGE MUST contain a SOAPAction HTTP header field
// with a quoted empty string value, if in the corresponding WSDL description,
// the soapAction attribute of soapbind:operation is either not present, or
- // present with an empty string as its value.
- String soapAction = null;
+ // present with an empty string as its value.
Map<String, Object> reqContext = getRequestContext();
- Boolean useSOAPAction =
(Boolean)reqContext.get(BindingProvider.SOAPACTION_USE_PROPERTY);
- if (Boolean.TRUE.equals(useSOAPAction))
+ String soapAction = (String)
reqContext.get(BindingProvider.SOAPACTION_URI_PROPERTY);;
+ Boolean useSOAPAction = (Boolean)
reqContext.get(BindingProvider.SOAPACTION_USE_PROPERTY);
+ if (Boolean.TRUE.equals(useSOAPAction) && soapAction == null)
{
- soapAction = (String)reqContext.get(BindingProvider.SOAPACTION_URI_PROPERTY);
- if (soapAction == null)
throw new IllegalStateException("Cannot obtain: " +
BindingProvider.SOAPACTION_URI_PROPERTY);
}
+
MimeHeaders mimeHeaders = reqMsg.getMimeHeaders();
mimeHeaders.addHeader("SOAPAction", soapAction != null ? soapAction :
"");
Modified:
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/DispatchSOAPBinding.java
===================================================================
---
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/DispatchSOAPBinding.java 2010-03-29
06:01:11 UTC (rev 11880)
+++
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/jaxws/client/DispatchSOAPBinding.java 2010-03-30
06:51:46 UTC (rev 11881)
@@ -149,7 +149,12 @@
try
{
if (SOAPMessage.class.isAssignableFrom(type))
- {
+ {
+ //Throw Exception if this is soap fault message
+ SOAPBodyImpl soapBody = (SOAPBodyImpl)resMsg.getSOAPBody();
+ SOAPFault soapFault = soapBody.getFault();
+ if (soapFault != null)
+ throw new SOAPFaultException(soapFault);
retObj = resMsg;
}
else if (Source.class.isAssignableFrom(type))
Modified:
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingServerHandler.java
===================================================================
---
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingServerHandler.java 2010-03-29
06:01:11 UTC (rev 11880)
+++
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingServerHandler.java 2010-03-30
06:51:46 UTC (rev 11881)
@@ -23,6 +23,7 @@
import org.jboss.logging.Logger;
import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.core.soap.SOAPFaultImpl;
import org.jboss.ws.extensions.addressing.AddressingConstantsImpl;
import org.jboss.ws.extensions.addressing.metadata.AddressingOpMetaExt;
import org.jboss.ws.metadata.umdm.OperationMetaData;
@@ -31,8 +32,13 @@
import org.w3c.dom.Element;
import javax.xml.namespace.QName;
+import javax.xml.soap.Detail;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPFault;
import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.BindingProvider;
import javax.xml.ws.FaultAction;
+import javax.xml.ws.WebServiceException;
import javax.xml.ws.addressing.AddressingBuilder;
import javax.xml.ws.addressing.JAXWSAConstants;
import javax.xml.ws.addressing.soap.SOAPAddressingBuilder;
@@ -41,6 +47,7 @@
import javax.xml.ws.handler.MessageContext.Scope;
import javax.xml.ws.handler.soap.SOAPMessageContext;
import javax.xml.ws.soap.AddressingFeature;
+import javax.xml.ws.soap.SOAPFaultException;
import java.net.URISyntaxException;
import java.util.Collections;
@@ -106,6 +113,35 @@
msgContext.setScope(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND,
Scope.APPLICATION);
msgContext.put(MessageContext.REFERENCE_PARAMETERS,
convertToElementList(addrProps.getReferenceParameters().getElements()));
msgContext.setScope(MessageContext.REFERENCE_PARAMETERS, Scope.APPLICATION);
+
+ //check if soap action matches wsa action
+ String[] soapActions =
commonMsgContext.getMessageAbstraction().getMimeHeaders().getHeader("SOAPAction");
+ if (soapActions != null && soapActions.length > 0)
+ {
+ String soapAction = soapActions[0];
+ if (!soapAction.equals("\"\"") &&
addrProps.getAction() != null)
+ {
+ String wsaAction = addrProps.getAction().getURI().toString();
+ // R1109 The value of the SOAPAction HTTP header field in a HTTP request
MESSAGE MUST be a quoted string.
+ if (!soapAction.equals(wsaAction) &&
!soapAction.equals("\"" + wsaAction + "\""))
+ {
+ try
+ {
+ SOAPFault fault = new SOAPFaultImpl();
+ fault.setFaultCode(new QName(ADDR_CONSTANTS.getNamespaceURI(),
"ActionMismatch"));
+ fault.setFaultString("Mismatch between soap action:" +
soapAction + " and wsa action:\""
+ + addrProps.getAction().getURI() + "\"");
+ Detail detail = fault.addDetail();
+ detail.addDetailEntry(new QName(ADDR_CONSTANTS.getNamespaceURI(),
"ProblemAction"));
+ throw new SOAPFaultException(fault);
+ }
+ catch (SOAPException e)
+ {
+ throw new WebServiceException(e);
+ }
+ }
+ }
+ }
return true;
}
Modified:
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml
===================================================================
---
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml 2010-03-29
06:01:11 UTC (rev 11880)
+++
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml 2010-03-30
06:51:46 UTC (rev 11881)
@@ -636,6 +636,19 @@
<include name="jboss-web.xml"/>
</webinf>
</war>
+
+ <!-- jaxws-jbws2978 -->
+ <war warfile="${tests.output.dir}/test-libs/jaxws-jbws2978.war"
webxml="${tests.output.dir}/test-resources/jaxws/jbws2978/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/test-classes">
+ <include
name="org/jboss/test/ws/jaxws/jbws2978/AddNumbers.class"/>
+ <include
name="org/jboss/test/ws/jaxws/jbws2978/AddNumbersImpl.class"/>
+ <include
name="org/jboss/test/ws/jaxws/jbws2978/AddNumbersRequest.class"/>
+ <include
name="org/jboss/test/ws/jaxws/jbws2978/AddNumbersResponse.class"/>
+ </classes>
+ <webinf
dir="${tests.output.dir}/test-resources/jaxws/jbws2978/WEB-INF">
+ <include name="jboss-web.xml"/>
+ </webinf>
+ </war>
<!-- jaxws-webserviceref -->
<war warfile="${tests.output.dir}/test-libs/jaxws-webserviceref.war"
webxml="${tests.output.dir}/test-resources/jaxws/webserviceref/WEB-INF/web.xml">
Added:
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2978/AddNumbers.java
===================================================================
---
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2978/AddNumbers.java
(rev 0)
+++
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2978/AddNumbers.java 2010-03-30
06:51:46 UTC (rev 11881)
@@ -0,0 +1,41 @@
+/*
+ * 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.jbws2978;
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebService;
+import javax.jws.WebResult;
+import javax.xml.ws.RequestWrapper;
+import javax.xml.ws.ResponseWrapper;
+
+@WebService(name = "AddNumbers", targetNamespace =
"http://ws.jboss.org")
+public interface AddNumbers {
+ @WebMethod
+ @WebResult(targetNamespace = "")
+ @RequestWrapper(localName = "addNumbersRequest", targetNamespace =
"http://ws.jboss.org", className =
"org.jboss.test.ws.jaxws.jbws2978.AddNumbersRequest")
+ @ResponseWrapper(localName = "addNumbersResponse", targetNamespace =
"http://ws.jboss.org", className =
"org.jboss.test.ws.jaxws.jbws2978.AddNumbersResponse")
+ public int addNumbersFault1(
+ @WebParam(name = "arg0", targetNamespace = "")
+ int arg0,
+ @WebParam(name = "arg1", targetNamespace = "")
+ int arg1);
+}
Added:
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2978/AddNumbersImpl.java
===================================================================
---
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2978/AddNumbersImpl.java
(rev 0)
+++
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2978/AddNumbersImpl.java 2010-03-30
06:51:46 UTC (rev 11881)
@@ -0,0 +1,37 @@
+/*
+ * 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.jbws2978;
+import javax.jws.WebParam;
+import javax.jws.WebService;
+import javax.xml.ws.addressing.Action;
+import javax.xml.ws.soap.Addressing;
+@WebService(name = "AddNumbers", portName = "AddNumbersPort",
serviceName = "AddNumbers", targetNamespace = "http://ws.jboss.org")
+@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)
+ {
+ return number1 + number2;
+ }
+}
Added:
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2978/AddNumbersRequest.java
===================================================================
---
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2978/AddNumbersRequest.java
(rev 0)
+++
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2978/AddNumbersRequest.java 2010-03-30
06:51:46 UTC (rev 11881)
@@ -0,0 +1,70 @@
+/*
+ * 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.jbws2978;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlType;
+
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "addNumbersRequest", propOrder = {
+ "arg0",
+ "arg1"
+})
+public class AddNumbersRequest {
+
+ protected int arg0;
+ protected int arg1;
+
+ /**
+ * Gets the value of the arg0 property.
+ *
+ */
+ public int getArg0() {
+ return arg0;
+ }
+
+ /**
+ * Sets the value of the arg0 property.
+ *
+ */
+ public void setArg0(int value) {
+ this.arg0 = value;
+ }
+
+ /**
+ * Gets the value of the arg1 property.
+ *
+ */
+ public int getArg1() {
+ return arg1;
+ }
+
+ /**
+ * Sets the value of the arg1 property.
+ *
+ */
+ public void setArg1(int value) {
+ this.arg1 = value;
+ }
+
+}
Added:
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2978/AddNumbersResponse.java
===================================================================
---
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2978/AddNumbersResponse.java
(rev 0)
+++
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2978/AddNumbersResponse.java 2010-03-30
06:51:46 UTC (rev 11881)
@@ -0,0 +1,54 @@
+/*
+ * 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.jbws2978;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "addNumbersResponse", propOrder = {
+ "_return"
+})
+public class AddNumbersResponse {
+
+ @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:
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2978/JBWS2978TestCase.java
===================================================================
---
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2978/JBWS2978TestCase.java
(rev 0)
+++
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2978/JBWS2978TestCase.java 2010-03-30
06:51:46 UTC (rev 11881)
@@ -0,0 +1,91 @@
+/*
+ * 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.jbws2978;
+
+import java.io.ByteArrayInputStream;
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Dispatch;
+import javax.xml.ws.Service;
+import javax.xml.ws.soap.SOAPFaultException;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * JBWS2978TestCase.
+ *
+ * @author <a href="ema(a)redhat.com">Jim Ma</a>
+ */
+public class JBWS2978TestCase extends JBossWSTest
+{
+
+ public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() +
":8080/jaxws-jbws2978";
+
+ private final String requestMessage = "<S:Envelope
xmlns:S='http://schemas.xmlsoap.org/soap/envelope/'><S:Head...
xmlns='http://www.w3.org/2005/08/addressing'>"
+ + TARGET_ENDPOINT_ADDRESS
+ + "</To><Action
xmlns='http://www.w3.org/2005/08/addressing'>inputAction</A...
+ + "<MessageID
xmlns='http://www.w3.org/2005/08/addressing'>uuid:56d586f8-980...
+ + "<ReplyTo
xmlns='http://www.w3.org/2005/08/addressing'><Address>ht...
+ + "</S:Header><S:Body><ns1:addNumbers
xmlns:ns1='http://ws.jboss.org'><arg0>10</arg0><arg1>10</arg1></ns1:addNumbers></S:Body></S:Envelope>";
+
+ public Service service = null;
+
+ public static Test suite() throws Exception
+ {
+ return new JBossWSTestSetup(JBWS2978TestCase.class,
"jaxws-jbws2978.war");
+ }
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
+ QName serviceName = new QName("http://ws.jboss.org",
"AddNumbers");
+ service = Service.create(wsdlURL, serviceName);
+ }
+
+ public void testCall() throws Exception
+ {
+ try
+ {
+ Dispatch dispatch = service.createDispatch(new
QName("http://ws.jboss.org", "AddNumbersPort"), SOAPMessage.class ,
+ Service.Mode.MESSAGE);
+ SOAPMessage reqMsg = MessageFactory.newInstance().createMessage(null,
+ new ByteArrayInputStream(requestMessage.getBytes()));
+ BindingProvider bp = (BindingProvider)dispatch;
+ java.util.Map<String, Object> requestContext = bp.getRequestContext();
+ requestContext.put(BindingProvider.SOAPACTION_URI_PROPERTY,
"mismatchAction");
+ dispatch.invoke(reqMsg);
+ fail("Should throw SOAPFaultExceptoin");
+ }
+ catch (SOAPFaultException e)
+ {
+ assertEquals(true,
e.getFault().getFaultCode().indexOf("ActionMismatch") > -1);
+ }
+ }
+}
\ No newline at end of file
Added:
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2978/WEB-INF/jboss-web.xml
===================================================================
---
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2978/WEB-INF/jboss-web.xml
(rev 0)
+++
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2978/WEB-INF/jboss-web.xml 2010-03-30
06:51:46 UTC (rev 11881)
@@ -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-jbws2978</context-root>
+</jboss-web>
\ No newline at end of file
Added:
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2978/WEB-INF/web.xml
===================================================================
---
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2978/WEB-INF/web.xml
(rev 0)
+++
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2978/WEB-INF/web.xml 2010-03-30
06:51:46 UTC (rev 11881)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+
+ <servlet>
+ <servlet-name>Endpoint</servlet-name>
+
<servlet-class>org.jboss.test.ws.jaxws.jbws2978.AddNumbersImpl</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>Endpoint</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
\ No newline at end of file