Microsoft.ServiceModel.Web.HelpPageInvoker.Invoke C# (CSharp) Method

Invoke() public method

public Invoke ( object instance, object inputs, object &outputs ) : object
instance object
inputs object
outputs object
return object
        public object Invoke(object instance, object[] inputs, out object[] outputs)
        {
            outputs = null;
            Message result = null;
            try
            {
                UriTemplateMatch match = (UriTemplateMatch)OperationContext.Current.IncomingMessageProperties["HelpPageMatch"];
                string operation = (string)match.Data;
                if (operation == "GetFeed")
                {
                    Atom10FeedFormatter feed = GetFeed();
                    WebOperationContext.Current.OutgoingResponse.ContentType = "application/atom+xml";
                    result = Message.CreateMessage(MessageVersion.None, null, feed);
                }
                else if (operation == "GetRequestSchema")
                {
                    result = GetRequestXmlSchema(match.BoundVariables["operation"]);
                }
                else if (operation == "GetRequestExample")
                {
                    result = GetRequestExample(match.BoundVariables["operation"]);
                }
                else if (operation == "GetResponseSchema")
                {
                    result = GetResponseXmlSchema(match.BoundVariables["operation"]);
                }
                else if (operation == "GetResponseExample")
                {
                    result = GetResponseExample(match.BoundVariables["operation"]);
                }
                else
                {
                    WebOperationContext.Current.OutgoingResponse.SetStatusAsNotFound();
                    result = Message.CreateMessage(MessageVersion.None, null);
                }
                if (result != null)
                {
                    CacheResult();
                }
                else
                {
                    WebOperationContext.Current.OutgoingResponse.SetStatusAsNotFound();
                }
            }
            catch (Exception e)
            {
                WebOperationContext.Current.OutgoingResponse.StatusCode = HttpStatusCode.InternalServerError;
                WebOperationContext.Current.OutgoingResponse.StatusDescription = e.Message;
            }
            return result;
        }