Author: richard.opalka(a)jboss.com
Date: 2011-08-13 15:30:15 -0400 (Sat, 13 Aug 2011)
New Revision: 14826
Modified:
thirdparty/cxf/branches/cxf-2.3.1/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/MAPAggregator.java
thirdparty/cxf/branches/cxf-2.3.1/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/Messages.properties
Log:
[CXF-3740] fixing WSA handler to throw WSException on client side if addressing headers
are not present in message but are required
Modified:
thirdparty/cxf/branches/cxf-2.3.1/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/MAPAggregator.java
===================================================================
---
thirdparty/cxf/branches/cxf-2.3.1/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/MAPAggregator.java 2011-08-13
19:10:48 UTC (rev 14825)
+++
thirdparty/cxf/branches/cxf-2.3.1/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/MAPAggregator.java 2011-08-13
19:30:15 UTC (rev 14826)
@@ -34,6 +34,7 @@
import javax.wsdl.extensions.ExtensibilityElement;
import javax.xml.namespace.QName;
import javax.xml.ws.WebFault;
+import javax.xml.ws.WebServiceException;
import org.apache.cxf.Bus;
import org.apache.cxf.binding.soap.SoapBindingConstants;
@@ -376,6 +377,7 @@
}
return null;
}
+
/**
* If the isRequestor(message) == true and isAddressRequired() == false
* Assert all the wsa related assertion to true
@@ -586,6 +588,15 @@
&& !getWSAddressingFeature(message).isAddressingRequired()) {
assertAddressing(message);
}
+ //CXF-3740 If the addressing headers are not present and
+ // WSAddressingFeature.isAddressingRequired is set to true , we need to throw
WebServiceException on client side
+ if (!ContextUtils.isOutbound(message) &&
ContextUtils.isRequestor(message)
+ && getWSAddressingFeature(message) != null
+ && getWSAddressingFeature(message).isAddressingRequired()
+ && theMaps == null) {
+ String reason =
BUNDLE.getString("MISSING_ADDRESSING_HEADERS");
+ throw new WebServiceException(reason);
+ }
//CXF-3060 :If wsa policy is not enforced, AddressingProperties map is null
and
// AddressingFeature.isRequired, requestor checks inbound message and throw
exception
if (null == theMaps
Modified:
thirdparty/cxf/branches/cxf-2.3.1/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/Messages.properties
===================================================================
---
thirdparty/cxf/branches/cxf-2.3.1/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/Messages.properties 2011-08-13
19:10:48 UTC (rev 14825)
+++
thirdparty/cxf/branches/cxf-2.3.1/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/Messages.properties 2011-08-13
19:30:15 UTC (rev 14826)
@@ -26,4 +26,5 @@
MAP_REQUIRED_MSG = Message Addressing Property {0} required
DUPLICATE_MESSAGE_ID_MSG = Duplicate Message ID {0}
INVALID_ADDRESSING_PROPERTY_MESSAGE = A header representing a Message Addressing Property
is not valid and the message cannot be processed
-MISSING_ACTION_MESSAGE = A required header representing a Message Addressing Property is
not present
\ No newline at end of file
+MISSING_ACTION_MESSAGE = A required header representing a Message Addressing Property is
not present
+MISSING_ADDRESSING_HEADERS = Missing addressing headers