Author: creed41 | Posted on: 8/14/2009 5:13:40 AM | Views : 1089

I am working on a project that needs to capture an xml document posted from a https site. Both sites are https.
Basically this is the code...
To post I am using:
WebRequest req = null;
WebResponse rsp = null;
try{
string fileName = "path to .xml";
String uri = "https://secureSitepostReader.aspx";
req = WebRequest.Create(uri);
req.Method = "POST"; // Post method
req.ContentType = "text/xml"; // content type
// Wrap the request stream with a text-based writer
StreamWriter writer = new StreamWriter(req.GetRequestStream());
StreamReader reader = new StreamReader(fileName);
string ret = reader.ReadToEnd();
reader.Close();
//Response.Write(ret);
 
// Write the XML text into the stream
writer.WriteLine(ret);
writer.Close();
// Send the data to the webserver
rsp = req.GetRe ...

Go to the complete details ...