protected com.sun.xml.ws.tx.common.TxBasePipe$OperationATPolicy | getOperationATPolicy(com.sun.xml.ws.policy.PolicyMap pmap, com.sun.xml.ws.api.model.wsdl.WSDLPort wsdlModel, com.sun.xml.ws.api.model.wsdl.WSDLBoundOperation wsdlBoundOp)
OperationATPolicy opat = new OperationATPolicy();
try {
if (pmap != null) {
PolicyMapKey opKey = pmap.
createWsdlOperationScopeKey(
wsdlModel.getOwner().getName(), // service
wsdlModel.getName(), // port
wsdlBoundOp.getName() // operation
);
Policy effectivePolicy =
pmap.getOperationEffectivePolicy(opKey);
if (effectivePolicy != null) {
Iterator<AssertionSet> assertionIter = effectivePolicy.iterator();
AssertionSet assertionSet;
while (assertionIter.hasNext()) {
assertionSet = assertionIter.next();
for (PolicyAssertion pa : assertionSet) {
// Check for 2004 WS-Atomic Transaction Policy Assertions
if (pa.getName().equals(AT_ASSERTION)) {
opat.atAssertion = (pa.isOptional() ? ALLOWED : MANDATORY);
// begin patch for wsit issue 419
if (opat.atAssertion == MANDATORY) {
String optionalBoolValue = pa.getAttributeValue(WSP2002_OPTIONAL);
if (optionalBoolValue != null && Boolean.valueOf(optionalBoolValue)) {
opat.atAssertion = ATAssertion.ALLOWED;
}
}
// end patch
} else if (pa.getName().equals(AT_ALWAYS_CAPABILITY)) {
opat.ATAlwaysCapability = true;
}
// TODO: To implement OASIS WS-Atomic Transaction,
// check for OASIS WS-Atomic Transaction Policy Assertion ATAssertion here
}
}
}
}
} catch (PolicyException pe) {
throw new WebServiceException(pe.getMessage(), pe);
}
return opat;
|