protected Operation findOperation(Context context) throws Exception {
QName interfaceName = (QName) context.getProperty(Context.INTERFACE);
QName serviceName = (QName) context.getProperty(Context.SERVICE);
String endpointName = (String) context.getProperty(Context.ENDPOINT);
ComponentContext componentContext = endpoint.getServiceUnit().getComponent().getComponentContext();
QName bodyName = context.getInMessage().getBodyName();
// Find target endpoint
ServiceEndpoint se = null;
if (serviceName != null && endpointName != null) {
se = componentContext.getEndpoint(serviceName, endpointName);
}
if (se == null && interfaceName != null) {
ServiceEndpoint[] ses = componentContext.getEndpoints(interfaceName);
if (ses != null && ses.length > 0) {
se = ses[0];
}
}