Author: dkulp
Date: Wed Jan 27 15:27:09 2010
New Revision: 903681
URL: http://svn.apache.org/viewvc?rev=903681&view=rev
Log:
[CXF-2629] Fix RM test failures caused by patch.
Update WS-RM to properly set the WS-A action attributes on it's
RMEndpoint instead of relying on the SOAPAction stuff.
Modified:
cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java
Modified:
cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java?rev=903681&r1=903680&r2=903681&view=diff
==============================================================================
---
cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
(original)
+++
cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
Wed Jan 27 15:27:09 2010
@@ -32,6 +32,7 @@
import org.apache.cxf.Bus;
import org.apache.cxf.binding.soap.SoapBindingConstants;
+import org.apache.cxf.binding.soap.model.SoapOperationInfo;
import org.apache.cxf.common.logging.LogUtils;
import org.apache.cxf.endpoint.ConduitSelector;
import org.apache.cxf.endpoint.Endpoint;
@@ -728,7 +729,6 @@
}
if (fault == null) {
action = (String)
message.get(SoapBindingConstants.SOAP_ACTION);
-
if (action == null || "".equals(action)) {
MessageInfo msgInfo =
ContextUtils.isRequestor(message)
@@ -740,6 +740,11 @@
} else {
action = cachedAction;
}
+ if (action == null && ContextUtils.isRequestor(message)) {
+ SoapOperationInfo soi =
+ bindingOpInfo.getExtensor(SoapOperationInfo.class);
+ action = soi == null ? null : soi.getAction();
+ }
}
} else {
Throwable t = fault.getCause();
Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java?rev=903681&r1=903680&r2=903681&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java
(original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java Wed
Jan 27 15:27:09 2010
@@ -54,6 +54,7 @@
import org.apache.cxf.service.model.OperationInfo;
import org.apache.cxf.service.model.ServiceInfo;
import org.apache.cxf.transport.Conduit;
+import org.apache.cxf.ws.addressing.JAXWSAConstants;
import org.apache.cxf.ws.addressing.Names;
import org.apache.cxf.ws.policy.EffectivePolicy;
import org.apache.cxf.ws.policy.EndpointPolicy;
@@ -463,55 +464,39 @@
SoapBindingInfo bi = new SoapBindingInfo(si, bindingId, sv);
bi.setName(BINDING_NAME);
BindingOperationInfo boi = null;
- SoapOperationInfo soi = null;
boi =
bi.buildOperation(RMConstants.getCreateSequenceOperationName(), RMConstants
.getCreateSequenceOperationName().getLocalPart(), null);
- soi = new SoapOperationInfo();
- soi.setAction(RMConstants.getCreateSequenceAction());
- boi.addExtensor(soi);
+ addAction(boi,
+ RMConstants.getCreateSequenceAction(),
+ RMConstants.getCreateSequenceResponseAction());
bi.addOperation(boi);
boi =
bi.buildOperation(RMConstants.getTerminateSequenceOperationName(), RMConstants
.getTerminateSequenceOperationName().getLocalPart(), null);
- soi = new SoapOperationInfo();
- soi.setAction(RMConstants.getTerminateSequenceAction());
- boi.addExtensor(soi);
+ addAction(boi, RMConstants.getTerminateSequenceAction());
bi.addOperation(boi);
boi = bi.buildOperation(RMConstants.getSequenceAckOperationName(),
null, null);
- assert null != boi;
- soi = new SoapOperationInfo();
- soi.setAction(RMConstants.getSequenceAckAction());
- boi.addExtensor(soi);
+ addAction(boi, RMConstants.getSequenceAckAction());
bi.addOperation(boi);
boi = bi.buildOperation(RMConstants.getLastMessageOperationName(),
null, null);
- assert null != boi;
- soi = new SoapOperationInfo();
- soi.setAction(RMConstants.getLastMessageAction());
- boi.addExtensor(soi);
+ addAction(boi, RMConstants.getLastMessageAction());
bi.addOperation(boi);
boi =
bi.buildOperation(RMConstants.getAckRequestedOperationName(), null, null);
- assert null != boi;
- soi = new SoapOperationInfo();
- soi.setAction(RMConstants.getAckRequestedAction());
- boi.addExtensor(soi);
+ addAction(boi, RMConstants.getAckRequestedAction());
bi.addOperation(boi);
boi =
bi.buildOperation(RMConstants.getCreateSequenceOnewayOperationName(),
RMConstants
.getCreateSequenceOperationName().getLocalPart(), null);
- soi = new SoapOperationInfo();
- soi.setAction(RMConstants.getCreateSequenceAction());
- boi.addExtensor(soi);
+ addAction(boi, RMConstants.getCreateSequenceAction());
bi.addOperation(boi);
boi =
bi.buildOperation(RMConstants.getCreateSequenceResponseOnewayOperationName(),
RMConstants
.getCreateSequenceResponseOperationName().getLocalPart(),
null);
- soi = new SoapOperationInfo();
- soi.setAction(RMConstants.getCreateSequenceResponseAction());
- boi.addExtensor(soi);
+ addAction(boi, RMConstants.getCreateSequenceResponseAction());
bi.addOperation(boi);
si.addBinding(bi);
@@ -520,6 +505,23 @@
// TODO: BindingFaultInfo (SequenceFault)
}
+ private void addAction(BindingOperationInfo boi, String action) {
+ addAction(boi, action, action);
+ }
+ private void addAction(BindingOperationInfo boi, String action, String
outputAction) {
+ SoapOperationInfo soi = new SoapOperationInfo();
+ soi.setAction(action);
+ boi.addExtensor(soi);
+
+ MessageInfo info = boi.getOperationInfo().getInput();
+ info.addExtensionAttribute(JAXWSAConstants.WSAW_ACTION_QNAME, action);
+
+ info = boi.getOperationInfo().getOutput();
+ if (info != null) {
+ info.addExtensionAttribute(JAXWSAConstants.WSAW_ACTION_QNAME,
outputAction);
+ }
+ }
+
Object getUsingAddressing(EndpointInfo endpointInfo) {
if (null == endpointInfo) {
return null;