You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by di...@apache.org on 2006/07/28 16:02:31 UTC
svn commit: r426539 - in /webservices/axis2/trunk/java/modules:
addressing/src/org/apache/axis2/handlers/addressing/
addressing/test/org/apache/axis2/handlers/addressing/
core/src/org/apache/axis2/ core/src/org/apache/axis2/transport/http/
core/src/org...
Author: dims
Date: Fri Jul 28 07:02:30 2006
New Revision: 426539
URL: http://svn.apache.org/viewvc?rev=426539&view=rev
Log:
Slightly modified version of patch from Brian for:
AXIS2-891 : Allow the WS-Addressing action to be set, in the client, without also setting the SOAP action
Modified:
webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java
webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingFinalInHandlerTest.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/Constants.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPTransportUtils.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/jms/JMSSender.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/njms/JMSUtils.java
Modified: webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java?rev=426539&r1=426538&r2=426539&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java (original)
+++ webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java Fri Jul 28 07:02:30 2006
@@ -144,8 +144,7 @@
messageContextOptions.setMessageId(soapHeaderBlock.getText());
soapHeaderBlock.setProcessed();
} else if (WSA_ACTION.equals(soapHeaderBlock.getLocalName()) && !ignoreAction) {
- messageContextOptions.setAction(soapHeaderBlock.getText());
- soapHeaderBlock.setProcessed();
+ extractActionInformation(messageContextOptions, soapHeaderBlock, namespace, messageContext);
} else if (WSA_RELATES_TO.equals(soapHeaderBlock.getLocalName())) {
extractRelatesToInformation(soapHeaderBlock, namespace, messageContextOptions);
}
@@ -265,6 +264,24 @@
extractToEprReferenceParameters(epr, header, namespace);
soapHeaderBlock.setProcessed();
+ }
+
+ //We assume that any action that already exists in the message context must be the
+ //soapaction. We compare that action to the WS-Addressing action, and if they are
+ //different we throw a fault.
+ private void extractActionInformation(Options messageContextOptions, SOAPHeaderBlock soapHeaderBlock, String addressingNamespace, MessageContext messageContext) throws AxisFault {
+ String soapAction = messageContextOptions.getAction();
+
+ if (soapAction != null && !"".equals(soapAction)) {
+ if (!soapAction.equals(soapHeaderBlock.getText())) {
+ throwFault(messageContext, WSA_ACTION, Final.FAULT_INVALID_HEADER, null);
+ }
+ }
+ else {
+ messageContextOptions.setAction(soapHeaderBlock.getText());
+ }
+
+ soapHeaderBlock.setProcessed();
}
/**
Modified: webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingFinalInHandlerTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingFinalInHandlerTest.java?rev=426539&r1=426538&r2=426539&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingFinalInHandlerTest.java (original)
+++ webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingFinalInHandlerTest.java Fri Jul 28 07:02:30 2006
@@ -1,182 +1,261 @@
-/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.axis2.handlers.addressing;
-
-import java.util.ArrayList;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.addressing.AddressingConstants;
-import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.client.Options;
-import org.apache.axis2.context.MessageContext;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-public class AddressingFinalInHandlerTest extends AddressingInHandlerTestBase {
-
- private Log log = LogFactory.getLog(getClass());
-
- /**
- * @param testName
- */
- public AddressingFinalInHandlerTest(String testName) {
- super(testName);
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- inHandler = new AddressingFinalInHandler();
- addressingNamespace = AddressingConstants.Final.WSA_NAMESPACE;
- versionDirectory = "final";
- fromAddress = "http://www.w3.org/2005/08/addressing/anonymous";
- secondRelationshipType = "http://some.custom.relationship";
- }
-
- public void testExtractAddressingInformationFromHeaders() {
- try {
- Options options = extractAddressingInformationFromHeaders();
-
- assertNotNull(options);
- assertNotNull(options.getTo());
-
- Map allReferenceParameters = options.getTo().getAllReferenceParameters();
- assertNotNull(allReferenceParameters);
- QName qName = new QName("http://ws.apache.org/namespaces/axis2", "ParamOne", "axis2");
- assertNotNull(allReferenceParameters.get(qName));
-
- assertEPRHasCorrectMetadata(options.getFrom());
- assertEPRHasCorrectMetadata(options.getFaultTo());
- assertEPRHasCorrectMetadata(options.getReplyTo());
-
- } catch (Exception e) {
- e.printStackTrace();
- log.error(e.getMessage());
- fail(" An Exception has occured " + e.getMessage());
- }
- }
-
- public void testMessageWithOmittedAction() {
- try {
- testMessageWithOmittedHeaders("noAction");
- fail("An AxisFault should have been thrown due to a missing Action header.");
- }
- catch (AxisFault af) {
- //test passed
- }
- catch (Exception e) {
- e.printStackTrace();
- log.error(e.getMessage());
- fail(" An Exception has occured " + e.getMessage());
- }
- }
-
- public void testMessageWithOmittedFaultTo() {
- try {
- testMessageWithOmittedHeaders("noFaultTo");
- }
- catch (AxisFault af) {
- af.printStackTrace();
- log.error(af.getMessage());
- fail("An unexpected AxisFault was thrown due to a missing FaultTo header.");
- }
- catch (Exception e) {
- e.printStackTrace();
- log.error(e.getMessage());
- fail(" An Exception has occured " + e.getMessage());
- }
- }
-
- public void testMessageWithOmittedFrom() {
- try {
- testMessageWithOmittedHeaders("noFrom");
- }
- catch (AxisFault af) {
- af.printStackTrace();
- log.error(af.getMessage());
- fail("An unexpected AxisFault was thrown due to a missing From header.");
- }
- catch (Exception e) {
- e.printStackTrace();
- log.error(e.getMessage());
- fail(" An Exception has occured " + e.getMessage());
- }
- }
-
- public void testMessageWithOmittedMessageID() {
- try {
- testMessageWithOmittedHeaders("noMessageID");
- }
- catch (AxisFault af) {
- af.printStackTrace();
- log.error(af.getMessage());
- fail("An unexpected AxisFault was thrown due to a missing MessageID header.");
- }
- catch (Exception e) {
- e.printStackTrace();
- log.error(e.getMessage());
- fail(" An Exception has occured " + e.getMessage());
- }
- }
-
- public void testMessageWithOmittedReplyTo() {
- try {
- testMessageWithOmittedHeaders("noReplyTo");
- }
- catch (AxisFault af) {
- af.printStackTrace();
- log.error(af.getMessage());
- fail("An unexpected AxisFault was thrown due to a missing ReplyTo header.");
- }
- catch (Exception e) {
- e.printStackTrace();
- log.error(e.getMessage());
- fail(" An Exception has occured " + e.getMessage());
- }
- }
-
- public void testMessageWithOmittedTo() {
- try {
- testMessageWithOmittedHeaders("noTo");
- }
- catch (AxisFault af) {
- af.printStackTrace();
- log.error(af.getMessage());
- fail("An unexpected AxisFault was thrown due to a missing To header.");
- }
- catch (Exception e) {
- e.printStackTrace();
- log.error(e.getMessage());
- fail(" An Exception has occured " + e.getMessage());
- }
- }
-
- private void assertEPRHasCorrectMetadata(EndpointReference epr){
- ArrayList metadata = epr.getMetaData();
- if(metadata != null){
- OMElement md = (OMElement)metadata.get(0);
- assertEquals(md.getQName(),new QName("http://ws.apache.org/namespaces/axis2","MetaExt"));
- assertEquals(md.getText(),"123456789");
- assertEquals(md.getAttributeValue(new QName("http://ws.apache.org/namespaces/axis2","AttrExt")),"123456789");
- }else{
- fail("No Metadata found in EPR");
- }
- }
-}
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.axis2.handlers.addressing;
+
+import java.util.ArrayList;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.addressing.AddressingConstants;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.client.Options;
+import org.apache.axis2.context.MessageContext;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+public class AddressingFinalInHandlerTest extends AddressingInHandlerTestBase {
+
+ private Log log = LogFactory.getLog(getClass());
+
+ /**
+ * @param testName
+ */
+ public AddressingFinalInHandlerTest(String testName) {
+ super(testName);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ inHandler = new AddressingFinalInHandler();
+ addressingNamespace = AddressingConstants.Final.WSA_NAMESPACE;
+ versionDirectory = "final";
+ fromAddress = "http://www.w3.org/2005/08/addressing/anonymous";
+ secondRelationshipType = "http://some.custom.relationship";
+ }
+
+ public void testExtractAddressingInformationFromHeaders() {
+ try {
+ Options options = extractAddressingInformationFromHeaders();
+
+ assertNotNull(options);
+ assertNotNull(options.getTo());
+
+ Map allReferenceParameters = options.getTo().getAllReferenceParameters();
+ assertNotNull(allReferenceParameters);
+ QName qName = new QName("http://ws.apache.org/namespaces/axis2", "ParamOne", "axis2");
+ assertNotNull(allReferenceParameters.get(qName));
+
+ assertEPRHasCorrectMetadata(options.getFrom());
+ assertEPRHasCorrectMetadata(options.getFaultTo());
+ assertEPRHasCorrectMetadata(options.getReplyTo());
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ log.error(e.getMessage());
+ fail(" An Exception has occured " + e.getMessage());
+ }
+ }
+
+ public void testMessageWithOmittedAction() {
+ try {
+ testMessageWithOmittedHeaders("noAction");
+ fail("An AxisFault should have been thrown due to a missing Action header.");
+ }
+ catch (AxisFault af) {
+ //test passed
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ log.error(e.getMessage());
+ fail(" An Exception has occured " + e.getMessage());
+ }
+ }
+
+ public void testMessageWithOmittedFaultTo() {
+ try {
+ testMessageWithOmittedHeaders("noFaultTo");
+ }
+ catch (AxisFault af) {
+ af.printStackTrace();
+ log.error(af.getMessage());
+ fail("An unexpected AxisFault was thrown due to a missing FaultTo header.");
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ log.error(e.getMessage());
+ fail(" An Exception has occured " + e.getMessage());
+ }
+ }
+
+ public void testMessageWithOmittedFrom() {
+ try {
+ testMessageWithOmittedHeaders("noFrom");
+ }
+ catch (AxisFault af) {
+ af.printStackTrace();
+ log.error(af.getMessage());
+ fail("An unexpected AxisFault was thrown due to a missing From header.");
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ log.error(e.getMessage());
+ fail(" An Exception has occured " + e.getMessage());
+ }
+ }
+
+ public void testMessageWithOmittedMessageID() {
+ try {
+ testMessageWithOmittedHeaders("noMessageID");
+ }
+ catch (AxisFault af) {
+ af.printStackTrace();
+ log.error(af.getMessage());
+ fail("An unexpected AxisFault was thrown due to a missing MessageID header.");
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ log.error(e.getMessage());
+ fail(" An Exception has occured " + e.getMessage());
+ }
+ }
+
+ public void testMessageWithOmittedReplyTo() {
+ try {
+ testMessageWithOmittedHeaders("noReplyTo");
+ }
+ catch (AxisFault af) {
+ af.printStackTrace();
+ log.error(af.getMessage());
+ fail("An unexpected AxisFault was thrown due to a missing ReplyTo header.");
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ log.error(e.getMessage());
+ fail(" An Exception has occured " + e.getMessage());
+ }
+ }
+
+ public void testMessageWithOmittedTo() {
+ try {
+ testMessageWithOmittedHeaders("noTo");
+ }
+ catch (AxisFault af) {
+ af.printStackTrace();
+ log.error(af.getMessage());
+ fail("An unexpected AxisFault was thrown due to a missing To header.");
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ log.error(e.getMessage());
+ fail(" An Exception has occured " + e.getMessage());
+ }
+ }
+
+ public void testDifferentSoapActionProcessing() {
+ String testfile = "valid-messages/"+versionDirectory+"/soapmessage.xml";
+ MessageContext mc = new MessageContext();
+
+ try {
+ mc.setSoapAction("http://ws.apache.org/tests/differentAction");
+ basicExtractAddressingInformationFromHeaders(testfile, mc);
+ fail("An AxisFault should have been thrown due to the soapaction being different to the ws-a action.");
+ }
+ catch (AxisFault af) {
+ //Test passed.
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ log.error(e.getMessage());
+ fail(" An Exception has occured " + e.getMessage());
+ }
+ }
+
+ public void testSameSoapAction() {
+ String testfile = "valid-messages/"+versionDirectory+"/soapmessage.xml";
+ MessageContext mc = new MessageContext();
+
+ try {
+ mc.setSoapAction("http://ws.apache.org/tests/action");
+ basicExtractAddressingInformationFromHeaders(testfile, mc);
+ }
+ catch (AxisFault af) {
+ af.printStackTrace();
+ log.error(af.getMessage());
+ fail("An unexpected AxisFault was thrown while testing with a soapaction and ws-a action that are the same.");
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ log.error(e.getMessage());
+ fail(" An Exception has occured " + e.getMessage());
+ }
+ }
+
+ public void testEmptySoapAction() {
+ String testfile = "valid-messages/"+versionDirectory+"/soapmessage.xml";
+ MessageContext mc = new MessageContext();
+
+ try {
+ mc.setSoapAction("");
+ basicExtractAddressingInformationFromHeaders(testfile, mc);
+ }
+ catch (AxisFault af) {
+ af.printStackTrace();
+ log.error(af.getMessage());
+ fail("An unexpected AxisFault was thrown while testing with an empty soapaction.");
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ log.error(e.getMessage());
+ fail(" An Exception has occured " + e.getMessage());
+ }
+ }
+
+ public void testNullSoapAction() {
+ String testfile = "valid-messages/"+versionDirectory+"/soapmessage.xml";
+ MessageContext mc = new MessageContext();
+
+ try {
+ mc.setSoapAction(null);
+ basicExtractAddressingInformationFromHeaders(testfile, mc);
+ }
+ catch (AxisFault af) {
+ af.printStackTrace();
+ log.error(af.getMessage());
+ fail("An unexpected AxisFault was thrown while testing with a null soapaction.");
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ log.error(e.getMessage());
+ fail(" An Exception has occured " + e.getMessage());
+ }
+ }
+
+ private void assertEPRHasCorrectMetadata(EndpointReference epr){
+ ArrayList metadata = epr.getMetaData();
+ if(metadata != null){
+ OMElement md = (OMElement)metadata.get(0);
+ assertEquals(md.getQName(),new QName("http://ws.apache.org/namespaces/axis2","MetaExt"));
+ assertEquals(md.getText(),"123456789");
+ assertEquals(md.getAttributeValue(new QName("http://ws.apache.org/namespaces/axis2","AttrExt")),"123456789");
+ }else{
+ fail("No Metadata found in EPR");
+ }
+ }
+}
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/Constants.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/Constants.java?rev=426539&r1=426538&r2=426539&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/Constants.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/Constants.java Fri Jul 28 07:02:30 2006
@@ -230,6 +230,11 @@
/** @deprecated please use org.apache.axis2.addressing.AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES */
public static final String DISABLE_ADDRESSING_FOR_OUT_MESSAGES = "disableAddressingForOutMessages";
+ // if this property is set to Boolean.TRUE then the SOAPAction header, if present,
+ // will NOT be set to the value of Options.getAction(). The empty value, "", will
+ // be used instead.
+ public static final String DISABLE_SOAP_ACTION = "disableSoapAction";
+
/**
* Field CHARACTER_SET_ENCODING
*/
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java?rev=426539&r1=426538&r2=426539&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java Fri Jul 28 07:02:30 2006
@@ -268,8 +268,10 @@
soapActionString = msgContext.getWSAAction();
}
-
- if (soapActionString == null) {
+ Object disableSoapAction =
+ msgContext.getOptions().getProperty(Constants.Configuration.DISABLE_SOAP_ACTION);
+
+ if (soapActionString == null || JavaUtils.isTrueExplicitly(disableSoapAction)) {
soapActionString = "\"\"";
} else if (soapActionString.startsWith("\"")) { // SOAPAction string must be a quoted string
soapActionString = "\"" + soapActionString + "\"";
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPTransportUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPTransportUtils.java?rev=426539&r1=426538&r2=426539&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPTransportUtils.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPTransportUtils.java Fri Jul 28 07:02:30 2006
@@ -123,7 +123,6 @@
soapAction = soapAction.substring(1, soapAction.length() - 1);
}
- msgContext.setWSAAction(soapAction);
msgContext.setSoapAction(soapAction);
msgContext.setTo(new EndpointReference(requestURI));
msgContext.setProperty(MessageContext.TRANSPORT_OUT, out);
@@ -168,7 +167,6 @@
}
// fill up the Message Contexts
- msgContext.setWSAAction(soapActionHeader);
msgContext.setSoapAction(soapActionHeader);
msgContext.setTo(new EndpointReference(requestURI));
msgContext.setProperty(MessageContext.TRANSPORT_OUT, out);
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/jms/JMSSender.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/jms/JMSSender.java?rev=426539&r1=426538&r2=426539&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/jms/JMSSender.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/jms/JMSSender.java Fri Jul 28 07:02:30 2006
@@ -22,6 +22,7 @@
import org.apache.axiom.soap.SOAPEnvelope;
import org.apache.axis2.AxisFault;
import org.apache.axis2.Constants;
+import org.apache.axis2.util.JavaUtils;
import org.apache.axis2.addressing.AddressingConstants;
import org.apache.axis2.client.Options;
import org.apache.axis2.context.ConfigurationContext;
@@ -502,7 +503,10 @@
soapActionString = msgCtx.getWSAAction();
}
- if (soapActionString == null) {
+ Object disableSoapAction =
+ msgCtx.getOptions().getProperty(Constants.Configuration.DISABLE_SOAP_ACTION);
+
+ if (soapActionString == null || JavaUtils.isTrueExplicitly(disableSoapAction)) {
soapActionString = "";
}
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/njms/JMSUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/njms/JMSUtils.java?rev=426539&r1=426538&r2=426539&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/njms/JMSUtils.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/njms/JMSUtils.java Fri Jul 28 07:02:30 2006
@@ -24,6 +24,7 @@
import org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder;
import org.apache.axis2.AxisFault;
import org.apache.axis2.Constants;
+import org.apache.axis2.util.JavaUtils;
import org.apache.axis2.context.MessageContext;
import org.apache.axis2.context.OperationContext;
import org.apache.axis2.description.AxisService;
@@ -249,9 +250,15 @@
private static String getSOAPAction(MessageContext msgCtx) {
String soapActionString = msgCtx.getSoapAction();
- if (soapActionString == null ||
- soapActionString.trim().length() == 0) {
+ if (soapActionString == null || soapActionString.trim().length() == 0) {
soapActionString = msgCtx.getWSAAction();
+ }
+
+ Object disableSoapAction =
+ msgCtx.getOptions().getProperty(Constants.Configuration.DISABLE_SOAP_ACTION);
+
+ if (soapActionString == null || JavaUtils.isTrueExplicitly(disableSoapAction)) {
+ soapActionString = "";
}
return soapActionString;
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org