@SuppressWarnings("unchecked")
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
Object result = method.invoke(httpBinding, args); // updates args
if (method.getName().equals("readRequest") && (args.length == 2)) {
HttpMessage message = (HttpMessage)args[1];
// prepare exchange for further inbound binding operations
message.getExchange().setIn(message);
// delegate further request binding operations to inbound binding
inboundBinding.readRequest(endpoint, message.getExchange(), (S)args[0]);
} else if (method.getName().equals("writeResponse") && (args.length == 2)) {
// delegate further response binding operations to inbound binding
inboundBinding.writeResponse(endpoint, (Exchange)args[0], (T)args[1]);
}
return result;