@Override
  public String processCall(String payload) throws SerializationException {
    try {
      String serviceName = extractServiceName(getThreadLocalRequest().getServletPath());
      Object service = applicationContext.getBean(serviceName);

      RPCRequest rpcRequest = RPC.decodeRequest(payload, service.getClass(), this);
      onAfterRequestDeserialized(rpcRequest);

      return RPC.invokeAndEncodeResponse(
          service,
          rpcRequest.getMethod(),
          rpcRequest.getParameters(),
          rpcRequest.getSerializationPolicy(),
          rpcRequest.getFlags());
    } catch (IncompatibleRemoteServiceException ex) {
      log("An IncompatibleRemoteServiceException was thrown while processing this call.", ex);
      return RPC.encodeResponseForFailure(null, ex);
    }
  }
Exemplo n.º 2
0
  public String processCall(String payload) throws SerializationException {
    // First, check for possible XSRF situation
    checkPermutationStrongName();

    try {
      Object handler = getBean(getThreadLocalRequest());
      RPCRequest rpcRequest = RPC.decodeRequest(payload, handler.getClass(), this);
      onAfterRequestDeserialized(rpcRequest);
      return RPC.invokeAndEncodeResponse(
          handler,
          rpcRequest.getMethod(),
          rpcRequest.getParameters(),
          rpcRequest.getSerializationPolicy(),
          rpcRequest.getFlags());
    } catch (IncompatibleRemoteServiceException ex) {
      log("An IncompatibleRemoteServiceException was thrown while processing this call.", ex);
      return RPC.encodeResponseForFailure(null, ex);
    } catch (RpcTokenException tokenException) {
      log("An RpcTokenException was thrown while processing this call.", tokenException);
      return RPC.encodeResponseForFailure(null, tokenException);
    }
  }