}
@SuppressWarnings("unchecked")
public Operation resolveMyRoleOperation(final OPartnerLink partnerLink, final String operationName) {
if (partnerLink.myRolePortType == null) {
throw new CompilationException(__cmsgs.errPartnerLinkDoesNotDeclareMyRole(partnerLink.getName()));
}
Operation found = CollectionsX.find_if((List<Operation>) partnerLink.myRolePortType.getOperations(),
new MemberOfFunction<Operation>() {
public boolean isMember(Operation o) {
// Again, guard against WSDL4J's "help"
if ((o.getInput() == null || o.getInput().getMessage() == null)
&& (o.getOutput() == null || o.getOutput().getMessage() == null))
return false;
return o.getName().equals(operationName);
}
});
if (found == null) {
throw new CompilationException(__cmsgs.errUndeclaredOperation(partnerLink.myRolePortType.getQName(),
operationName));
}
return found;
}