Mikal613
asked on
Send XML Read Xml ASP Page
I have an ASP Page
Visual Studio 2005, CF2 , C#
When i call my website i have to send a bunch of XML nodes , Probably coming from an exe (VS 2005 C#).
How do i do I send the XML and how does my Web Page Read the XML?
Visual Studio 2005, CF2 , C#
When i call my website i have to send a bunch of XML nodes , Probably coming from an exe (VS 2005 C#).
How do i do I send the XML and how does my Web Page Read the XML?
send to where? read from where?
ASKER
Heres the scenario
on 69.23.23.23 i have a webPage Default.aspx
I wanna send parameters FROM 213.345.234.122 to 69.23.23.23 and it will populate the info based on the parameters.
on 69.23.23.23 i have a webPage Default.aspx
I wanna send parameters FROM 213.345.234.122 to 69.23.23.23 and it will populate the info based on the parameters.
Mikal613 --
I just want to make sure I understand your question:
1) You have a Classic ASP page that needs to send some XML-formatted data to another website, and then interpret the XML that is returned.
2) The website that you are trying to communicate with, which is receiving the data and returning output, is running ASP.NET / C# (Visual Studio 2005).
Please tell us if this is accurate or not, so we can better assist you.
-= DeathToSpam =-
I just want to make sure I understand your question:
1) You have a Classic ASP page that needs to send some XML-formatted data to another website, and then interpret the XML that is returned.
2) The website that you are trying to communicate with, which is receiving the data and returning output, is running ASP.NET / C# (Visual Studio 2005).
Please tell us if this is accurate or not, so we can better assist you.
-= DeathToSpam =-
ASKER
1)Its a desktop App that will call the web page like
69.23.23.23\MyWebPage\Defa ult.aspx?I d=23,23,23 Name=45,45 ,45,45
and then my webpage some how should retrieve the Id's and Names
69.23.23.23\MyWebPage\Defa
and then my webpage some how should retrieve the Id's and Names
ASKER
Pref using XML
You will want to use the HttpWebRequest and HttpWebResponse classes to create a proxy that can read the uri streams (which, of course, will be in XML format).
The request (calling function) will look something like:
byte[] buff = System.Text.Encoding.ASCII
HttpWebRequest myHttpRequest = (HttpWebRequest)HttpWebReq
myHttpRequest.Method = "POST";
myHttpRequest.KeepAlive = false;
myHttpRequest.ContentType = "application/x-www-form-ur
myHttpRequest.ContentLengt
NetworkCredential cred = new NetworkCredential("user","
CredentialCache credCache = new CredentialCache();
credCache.Add(new Uri(serviceURI), "Basic", cred);
myHttpRequest.Credentials = credCache;
myHttpRequest.Timeout = 30000;
HttpWebResponse myHttpResponse = null;
string response = string.Empty;
Stream myRequestStream = null;
Stream baseStream = null;
try
{
myRequestStream = myHttpRequest.GetRequestSt
myRequestStream.Write(buff
myHttpResponse = (HttpWebResponse)myHttpReq
baseStream = myHttpResponse.GetResponse
XmlTextReader xmlRdr = new XmlTextReader(baseStream);
xmlRdr.MoveToContent();
response = HttpUtility.HtmlDecode(xml
}
You will want to use the HttpWebRequest and HttpWebResponse classes to create a proxy that can read the uri streams (which, of course, will be in XML format).
The request (calling function) will look something like:
byte[] buff = System.Text.Encoding.ASCII
HttpWebRequest myHttpRequest = (HttpWebRequest)HttpWebReq
myHttpRequest.Method = "POST";
myHttpRequest.KeepAlive = false;
myHttpRequest.ContentType = "application/x-www-form-ur
myHttpRequest.ContentLengt
NetworkCredential cred = new NetworkCredential("user","
CredentialCache credCache = new CredentialCache();
credCache.Add(new Uri(serviceURI), "Basic", cred);
myHttpRequest.Credentials = credCache;
myHttpRequest.Timeout = 30000;
HttpWebResponse myHttpResponse = null;
string response = string.Empty;
Stream myRequestStream = null;
Stream baseStream = null;
try
{
myRequestStream = myHttpRequest.GetRequestSt
myRequestStream.Write(buff
myHttpResponse = (HttpWebResponse)myHttpReq
baseStream = myHttpResponse.GetResponse
XmlTextReader xmlRdr = new XmlTextReader(baseStream);
xmlRdr.MoveToContent();
response = HttpUtility.HtmlDecode(xml
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.