Skip to content

Commit

Permalink
Also set policy credentials for message level policies
Browse files Browse the repository at this point in the history
Signed-off-by: Fabian Ohler <[email protected]>
  • Loading branch information
muued authored and lukasj committed Oct 11, 2023
1 parent f7ed96a commit e01b45c
Showing 1 changed file with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -732,12 +732,26 @@ protected void collectPolicies(List<PolicyAlternativeHolder> alternatives) {
//This will be used for setting credentials like spVersion... etc for binding level policies
setPolicyCredentials(endpointPolicy);

//This will be used for setting credentials like spVersion... etc for operation level policies
//This will be used for setting credentials like spVersion... etc for operation and message level policies
for (WSDLBoundOperation operation : tubeConfig.getWSDLPort().getBinding().getBindingOperations()) {
QName operationName = new QName(operation.getBoundPortType().getName().getNamespaceURI(), operation.getName().getLocalPart());
PolicyMapKey operationKey = PolicyMap.createWsdlOperationScopeKey(serviceName, portName, operationName);
Policy operationPolicy = wsPolicyMap.getOperationEffectivePolicy(operationKey);
setPolicyCredentials(operationPolicy);

PolicyMapKey messageKey = PolicyMap.createWsdlMessageScopeKey(
serviceName, portName, operationName);
Policy inputMessagePolicy = wsPolicyMap.getInputMessageEffectivePolicy(messageKey);
setPolicyCredentials(inputMessagePolicy);
Policy outputMessagePolicy = wsPolicyMap.getOutputMessageEffectivePolicy(messageKey);
setPolicyCredentials(outputMessagePolicy);
for (WSDLFault fault : operation.getOperation().getFaults()) {
PolicyMapKey faultKey = PolicyMap.createWsdlFaultMessageScopeKey(
serviceName, portName, operationName,
new QName(operationName.getNamespaceURI(), fault.getName()));
Policy faultPolicy = wsPolicyMap.getFaultMessageEffectivePolicy(faultKey);
setPolicyCredentials(faultPolicy);
}
}

if (endpointPolicy == null) {
Expand Down

0 comments on commit e01b45c

Please sign in to comment.