Y
Ying-CO
Here are my sending data part of the code:
-----------------------------------
XmlTextWriter myWriter = null;
HttpWebRequest myRequest;
XmlTextReader myXMLReader = null;
XmlDocument myDoc = null;
myDoc = new XmlDocument();
myDoc = Miscellaneous.CreateXMLDoc(); // will return a xml doc
// post xml file
myRequest =
(HttpWebRequest)WebRequest.Create("http://localhost:2772/Default.aspx");
myRequest.Method = "POST";
myRequest.ContentType = "text/xml";
myRequest.KeepAlive = false;
try
{
myWriter = new
XmlTextWriter(myRequest.GetRequestStream(),System.Text.Encoding.UTF8);
//myDoc =
Miscellaneous.CreateXMLDoc(txtLogin.Text,SubmissionInfo.StrPasswd);
myDoc.WriteContentTo(myWriter);
myWriter.Flush();
myWriter.Close();
}.............
Here is my receving data code in Default.aspx.cs file
---------------------------------------------------------
// Get input from client
HttpContext con = Context;
HttpRequest httpReq = con.Request;
httpReq.ContentType = "text/xml";
httpReq.RequestType = "GET";
XmlTextReader myXMLReader = new
XmlTextReader(httpReq.InputStream);
if (httpReq.InputStream.Length != 0)
{
}
The problem is the length of httpReq.InputStream is 0. Can you tell me
what's wrong?
Thank you very much in advance,
Ying
-----------------------------------
XmlTextWriter myWriter = null;
HttpWebRequest myRequest;
XmlTextReader myXMLReader = null;
XmlDocument myDoc = null;
myDoc = new XmlDocument();
myDoc = Miscellaneous.CreateXMLDoc(); // will return a xml doc
// post xml file
myRequest =
(HttpWebRequest)WebRequest.Create("http://localhost:2772/Default.aspx");
myRequest.Method = "POST";
myRequest.ContentType = "text/xml";
myRequest.KeepAlive = false;
try
{
myWriter = new
XmlTextWriter(myRequest.GetRequestStream(),System.Text.Encoding.UTF8);
//myDoc =
Miscellaneous.CreateXMLDoc(txtLogin.Text,SubmissionInfo.StrPasswd);
myDoc.WriteContentTo(myWriter);
myWriter.Flush();
myWriter.Close();
}.............
Here is my receving data code in Default.aspx.cs file
---------------------------------------------------------
// Get input from client
HttpContext con = Context;
HttpRequest httpReq = con.Request;
httpReq.ContentType = "text/xml";
httpReq.RequestType = "GET";
XmlTextReader myXMLReader = new
XmlTextReader(httpReq.InputStream);
if (httpReq.InputStream.Length != 0)
{
}
The problem is the length of httpReq.InputStream is 0. Can you tell me
what's wrong?
Thank you very much in advance,
Ying