Author: jim.ma
Date: 2010-02-08 22:12:41 -0500 (Mon, 08 Feb 2010)
New Revision: 11545
Added:
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2926/
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2926/JBWS2926TestCase.java
Modified:
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingClientHandler.java
Log:
JBWS-2926:set soap action value to wsa action
Modified:
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingClientHandler.java
===================================================================
---
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingClientHandler.java 2010-02-08
00:25:11 UTC (rev 11544)
+++
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/extensions/addressing/jaxws/WSAddressingClientHandler.java 2010-02-09
03:12:41 UTC (rev 11545)
@@ -32,6 +32,7 @@
import javax.xml.namespace.QName;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.BindingProvider;
import javax.xml.ws.addressing.AddressingBuilder;
import javax.xml.ws.addressing.AddressingException;
import javax.xml.ws.addressing.JAXWSAConstants;
@@ -104,7 +105,14 @@
try
{
OperationMetaData opMetaData =
((CommonMessageContext)msgContext).getOperationMetaData();
- addrProps.setAction(ADDR_BUILDER.newURI(opMetaData.getJavaName()));
+ if (msgContext.get(BindingProvider.SOAPACTION_URI_PROPERTY) != null)
+ {
+
addrProps.setAction(ADDR_BUILDER.newURI(msgContext.get(BindingProvider.SOAPACTION_URI_PROPERTY).toString()));
+ }
+ else
+ {
+ addrProps.setAction(ADDR_BUILDER.newURI(opMetaData.getJavaName()));
+ }
}
catch (URISyntaxException ex)
{
Added:
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2926/JBWS2926TestCase.java
===================================================================
---
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2926/JBWS2926TestCase.java
(rev 0)
+++
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2926/JBWS2926TestCase.java 2010-02-09
03:12:41 UTC (rev 11545)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.jbws2926;
+
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.addressing.JAXWSAConstants;
+import javax.xml.ws.addressing.soap.SOAPAddressingProperties;
+import javax.xml.ws.handler.MessageContext;
+
+import junit.framework.TestCase;
+
+import org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS;
+import org.jboss.ws.extensions.addressing.jaxws.WSAddressingClientHandler;
+import org.jboss.ws.extensions.addressing.soap.SOAPAddressingPropertiesImpl;
+
+/**
+ * JBWS2926TestCase.
+ *
+ * @author <a href="ema(a)redhat.com">Jim Ma</a>
+ */
+public class JBWS2926TestCase extends TestCase
+{
+
+
+ public void testWsaAction() throws Exception
+ {
+ WSAddressingClientHandler wsHandler = new WSAddressingClientHandler();
+ SOAPMessageContextJAXWS context = new SOAPMessageContextJAXWS();
+ context.put(MessageContext.MESSAGE_OUTBOUND_PROPERTY, new Boolean(true));
+ context.put(BindingProvider.SOAPACTION_URI_PROPERTY, "inputAction");
+ context.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES, new
SOAPAddressingPropertiesImpl());
+ context.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, new
SOAPAddressingPropertiesImpl());
+ MessageFactory factory = MessageFactory.newInstance();
+ SOAPMessage soapMsg = factory.createMessage();
+ context.setMessage(soapMsg);
+ wsHandler.handleMessage(context);
+ SOAPAddressingProperties addrProps =
(SOAPAddressingProperties)context.get(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND);
+ assertEquals(addrProps.getAction().getURI().toString(), "inputAction");
+
+ }
+}
\ No newline at end of file