*
* Note that this is not done in the EndpointController since operations are only relevant
* to Endpoint-based implementation (i.e. not to Proxy-based ones)s
*/
public static OperationDescription getOperationDescription(MessageContext mc) {
OperationDescription op = null;
op = mc.getOperationDescription();
if (op == null) {
if (log.isDebugEnabled()) {
log.debug("No OperationDescription found on MessageContext, searching existing operations");
}
EndpointDescription ed = mc.getEndpointDescription();
EndpointInterfaceDescription eid = ed.getEndpointInterfaceDescription();
OperationDescription[] ops = eid.getDispatchableOperation(mc.getOperationName());
// TODO: Implement signature matching. Currently only matching on the wsdl:OperationName is supported.
// That means that overloading of wsdl operations is not supported (although that's not supported in
// WSDL 1.1 anyway).
if (ops == null || ops.length == 0) {
throw ExceptionFactory.makeWebServiceException(
Messages.getMessage("oprDescrErr",mc.getOperationName().toString()));
}
if (ops.length > 1) {
throw ExceptionFactory.makeWebServiceException(
Messages.getMessage("oprDescrErr1",mc.getOperationName().toString()));
}
op = ops[0];
if (log.isDebugEnabled()) {
log.debug("wsdl operation: " + op.getName());
log.debug(" java method: " + op.getJavaMethodName());
}
}
else {
if (log.isDebugEnabled()) {
log.debug("An existing OperationDescription was found on the MessageContext.");