예제 #1
0
        public string AddNoteJson()
        {
            using (servicedeskfeeds.ServiceDesk1 feed = new servicedeskfeeds.ServiceDesk1())
            {
                try
                {
                    StreamReader reader = new StreamReader(Context.Request.InputStream);
                    Context.Request.InputStream.Position = 0;
                    String  Body = reader.ReadToEnd().ToString();
                    string  isPublic = "", noteText = "", Request = "", api = "";
                    JObject json = JObject.Parse(Body);
                    isPublic = (string)json["isPublic"];
                    noteText = (string)json["Note"];
                    Request  = (string)json["Request"];
                    api      = (string)json["api"];


                    feed.AddNote(isPublic, noteText, Request, api);
                    return(" Success");
                }
                catch (Exception ex)
                {
                    return("Failed: " + ex);
                }
            }
        }
예제 #2
0
 public void AddNote(string isPublic, string noteText, string Request, string api)
 {
     using (servicedeskfeeds.ServiceDesk1 feed = new servicedeskfeeds.ServiceDesk1())
     {
         string ret = feed.AddNote(isPublic, noteText, Request, api);
         HttpContext.Current.Response.Write(ret.Replace("<string xmlns=\"http://tempuri.org/\">", "").Replace("</string>", ""));
     }
 }