throw new IllegalStateException("The client has been closed.");
}
Endpoint endpoint = getClient().getEndpoint();
String address = endpoint.getEndpointInfo().getAddress();
MethodDispatcher dispatcher = (MethodDispatcher)endpoint.getService().get(
MethodDispatcher.class
.getName());
Object[] params = args;
if (null == params) {
params = new Object[0];
}
try {
if (method.getDeclaringClass().equals(BindingProvider.class)
|| method.getDeclaringClass().equals(Object.class)
|| method.getDeclaringClass().equals(Closeable.class)) {
return method.invoke(this, params);
} else if (method.getDeclaringClass().isInstance(client)) {
return method.invoke(client, params);
}
} catch (InvocationTargetException e) {
throw e.getCause();
}
BindingOperationInfo oi = dispatcher.getBindingOperation(method, endpoint);
if (oi == null) {
Message msg = new Message("NO_BINDING_OPERATION_INFO", LOG, method.getName());
throw new WebServiceException(msg.toString());
}