public Object Execute(IXmlRpcRequest request) { if (_mapping.AuthenticationHandler != null && !_mapping.AuthenticationHandler.IsAuthorized(request)) { throw new XmlRpcException("Not authorized"); } if (request.Target == null && _targetProvider != null) { request.Target = _targetProvider.GetTarget(request); } IXmlRpcHandler handler = (IXmlRpcHandler)request.Target; return(handler.Execute(request)); }
private MethodCall DeserializeRequest(ITransportHeaders requestHeaders, Stream requestStream, IXmlRpcStreamRequestConfig config) { String requestUri = GetRequestUri(requestHeaders); Type svcType = GetServerTypeForUri(requestUri); if (!_mapping.Has(svcType)) { _mapping.Register(svcType); } IXmlRpcRequest request = GetRequest(config, requestStream); IXmlRpcHandler handler = GetHandler(request); Header[] headers = GetChannelHeaders(requestUri, request, handler, svcType); MethodCall call = new MethodCall(headers); call.ResolveMethod(); return(call); }
private static Header[] GetChannelHeaders(String requestUri, IXmlRpcRequest request, IXmlRpcHandler handler, Type type) { List<Header> headers = new List<Header>(); headers.Add(new Header("__Uri", requestUri)); headers.Add(new Header("__TypeName", type.AssemblyQualifiedName)); headers.Add(new Header("__MethodName", handler.GetMethod(request).Name)); headers.Add(new Header("__Args", request.Parameters)); return headers.ToArray(); }
/// <summary> /// Executes a XML-RPC request. /// </summary> /// <param name="request">the <see cref="LX.EasyWeb.XmlRpc.IXmlRpcRequest"/> to execute</param> /// <returns>a result object</returns> /// <exception cref="LX.EasyWeb.XmlRpc.XmlRpcException">no matched handler is found, or an exception occurs when handling the request</exception> public Object Execute(IXmlRpcRequest request) { IXmlRpcHandler handler = GetHandler(request); return(handler.Execute(request)); }
private static Header[] GetChannelHeaders(String requestUri, IXmlRpcRequest request, IXmlRpcHandler handler, Type type) { List <Header> headers = new List <Header>(); headers.Add(new Header("__Uri", requestUri)); headers.Add(new Header("__TypeName", type.AssemblyQualifiedName)); headers.Add(new Header("__MethodName", handler.GetMethod(request).Name)); headers.Add(new Header("__Args", request.Parameters)); return(headers.ToArray()); }
public String GetMethodHelp(String name) { IXmlRpcHandler handler = GetHandler(name); return(handler is IXmlRpcMetaDataHandler ? ((IXmlRpcMetaDataHandler)handler).MethodHelp : null); }
public String[][] GetMethodSignature(String name) { IXmlRpcHandler handler = GetHandler(name); return(handler is IXmlRpcMetaDataHandler ? ((IXmlRpcMetaDataHandler)handler).Signatures : null); }