// GET: Basic
        public ActionResult executeMessage(string project, string webservice, string httpaction)
        {
            String result;

            Response.ContentType = @"text/plain";
            ClientConfiguration clientConfig = ClientConfiguration.getClientConfiguration();

            using (AxAccess axAccess = new AxAccess(this.User.Identity.Name, this.Request.Url.AbsolutePath, httpaction, clientConfig))
            {
                try
                {
                    Response.ContentType = @"text/plain";
                    //remove the soap envelope
                    string content = this.GetInputContent();
                    // add the  content back to the correct soap response
                    result = axAccess.executeWebservice(project, webservice, content);
                }
                catch (Exception ex)
                {
                    result = String.Format("<xml>Error: {0}</xml>", ex.Message);
                }
            }


            return(Content(result));
        }
Example #2
0
        //
        // GET: /REST/

        // GET: REST
        public ActionResult executeMessage(string project, string webservice)
        {
            //try
            //{
            string httpaction = this.Request.HttpMethod.ToString();

            String result;

            Response.ContentType = @"text/plain";
            ClientConfiguration clientConfig = ClientConfiguration.getClientConfiguration();

            //this.User.Identity.Name

            using (AxAccess axAccess = new AxAccess(this.User.Identity.Name, this.Request.Url.OriginalString, httpaction, clientConfig))
            {
                try
                {
                    Response.ContentType = @"text/plain";

                    string content = this.GetInputContent();
                    // add the  content back to the correct soap response
                    result = axAccess.executeWebservice(project, webservice, content);
                    this.Response.StatusCode = (int)axAccess.StatusCode;
                }
                catch (Exception ex)
                {
                    result = String.Format("<xml>Error: {0}</xml>", ex.Message);
                    this.Response.StatusCode = (int)System.Net.HttpStatusCode.InternalServerError;
                }
                //result = "SOAP" + "" + axAccess.executewebservice(this, project, webservice, httpaction);
            }
            return(Content(result));
            //}
            //catch
            //{
            //    return View();
            //}
        }