}
}
}
protected BindingOperationInfo findOperation(String suffix) {
BindingInfo bi = client.getEndpoint().getBinding().getBindingInfo();
for (BindingOperationInfo boi : bi.getOperations()) {
SoapOperationInfo soi = boi.getExtensor(SoapOperationInfo.class);
String soapAction = soi != null ? soi.getAction() : null;
Object o = boi.getOperationInfo().getInput()
.getExtensionAttribute(new QName("http://www.w3.org/2007/05/addressing/metadata",
"Action"));
if (o instanceof QName) {
o = ((QName)o).getLocalPart();
}
String wsamAction = o == null ? null : o.toString();
if ((soapAction != null && soapAction.endsWith(suffix))
|| (wsamAction != null && wsamAction.endsWith(suffix))) {
PolicyEngine pe = bus.getExtension(PolicyEngine.class);
Conduit conduit = client.getConduit();
EffectivePolicy effectivePolicy = pe.getEffectiveClientRequestPolicy(client.getEndpoint()
.getEndpointInfo(), boi, conduit);
setPolicyInternal(effectivePolicy.getPolicy());
return boi;
}
}
//operation is not correct as the Action is not set correctly. Let's see if
//we can at least find it by name and then set the action and such manually later.
for (BindingOperationInfo boi : bi.getOperations()) {
if (suffix.endsWith(boi.getName().getLocalPart())) {
return boi;
}
}
//Still didn't find anything useful
for (BindingOperationInfo boi : bi.getOperations()) {
if (boi.getInput().getMessageInfo().getMessageParts().size() > 0) {
MessagePartInfo mpi = boi.getInput().getMessageInfo().getMessagePart(0);
if ("RequestSecurityToken".equals(mpi.getConcreteName().getLocalPart())) {
return boi;
}