Link to home
Start Free TrialLog in
Avatar of supreeths84
supreeths84

asked on

XMLHttpRequest Equivalent in C#

I have to create a simple winform which will take in the URL and the input request XML as a parameter and once the user hits the Submit button, the response has to be submitted in a text box. I implemented the same in a .html file and the sequence of operations after the Submit button is hit is shown below:

document.forms["testForm"].resultXML.value = 'Please Wait....'

              var xmlhttp = new XMLHttpRequest()

            xmlhttp.open("POST", document.forms["testForm"].uri.value,true);

            xmlhttp.setRequestHeader("Man", "POST " + document.forms["testForm"].uri.value + "HTTP/1.1")

            xmlhttp.setRequestHeader("MessageType", "CALL")

             xmlhttp.setRequestHeader("Content-Type", "text/xml")

             xmlhttp.send(document.forms["testForm"].requestXML.value)

             xmlhttp.onreadystatechange = function() {

                   document.forms["testForm"].resultXML.value = xmlhttp.responseText

                   }

            }

Sample code in C# will be helpful to do the above operations.
 
ASKER CERTIFIED SOLUTION
Avatar of supreeths84
supreeths84

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of supreeths84
supreeths84

ASKER

The response time was slow and I could get the answer myself after a bit of searching on the internet