c# - Get XML doc sent -


itemprop = "text">

I have 2 projects - 1 purely. The hacks are generic handlers, and the other is a test project for which an XML doctor posts

  string xmlToSend = "& lt ;? xml version = \" 1.0    

\ "encoding = \" utf-8 \ "? & Gt; gt; 12 & lt; / APPLICATION & gt; "; WebRequest webRequest = WebRequest.Create (new url ("http: // localhost: 8022 / handle.ashx")); WebRequest.ContentType = "text / xml"; WebRequest.method = "post"; Byte [] bytes = encoding. ASCII.GetBytes (xmlToSend); Stream os = null; WebRequest.ContentLength = bytes.Length; OS = webRequest.GetRequestStream (); Os.Write (byte, 0, bytes lang); Os.Close (); WebResponse webResponse = webRequest.GetResponse (); // if (webResponse == zero) // {return tap; } StreamReader sr = new streamrider (webResponse.GetResponsestream ()); String sRet = ""; SRet = sr.ReadToEnd (). Trim ();

is a code received

  public zero process measure (http reference reference) {// OK, not sure what to do here // context .Request.Params have a number of 48, but XML is not counted in the context.Request.Form 0.} I know that I am missing some basics here . But I can not understand it for my life.  

Please do not suggest using WCF, unless it is the only way that I am going to work it. WCF seems very difficult and difficult to get me up and go.

I can not even take my handler to break on my breakpoint, but I know that it is being called (I have changed it several times to return the date, date and time , I type some kind of wired stars, so I know that it is being called and can answer back.)

This includes the data you are looking for.

Microsoft's example:

  System. Io Stream string; String strmContents; Int32 counter, stroll, stride; // Create a stream object Str = Request.InputStream; // Find the number of bytes in the stream. StrLen = Convert toInt32 (str.Length); // Create a byte array byte [strArr = new byte [string]; Read the stream in the // byte array StrRead = str.Read (strarr, 0, strLen); // Convert byte array to a text string StrmContents = ""; {StrmContents = strmContents + strarr [Counter] for (counter = 0; counter & lt; strLen; counter ++) Toasting (); }   

There are other better ways of working with text or using better.

Comments