hi All,
I have written the following code to get a webresponse.
the execuion gets stuck at "WebRespons e httpRes = httpRQ.GetRespo nse();". it doesn't throw any any error but just gets hanged up. the xml request generated is correct as it gives me the response with Altova xmlspy.
Can anyone please spot out the mistake in this code.
Thanks
I have written the following code to get a webresponse.
Code:
XmlDocument myxmlDoc1 = new XmlDocument(); myxmlDoc1.LoadXml(BkXMLRQ); string s = myxmlDoc1.OuterXml; System.Text.ASCIIEncoding encoding1 = new System.Text.ASCIIEncoding(); Byte[] byt1 = encoding.GetBytes(myxmlDoc1.OuterXml); WebRequest httpRQ = WebRequest.Create(InterfaceURL); httpRQ.ContentType = "text/xml"; httpRQ.ContentLength = BkXMLRQ.Length; httpRQ.Method = "POST"; //httpRQ.Timeout = 90000; System.IO.Stream ioStream1 = httpRQ.GetRequestStream(); ioStream1.Write(byt1, 0, byt1.Length); //It Gets Stuck Here WebResponse httpRes = httpRQ.GetResponse(); System.IO.Stream ResStream1 = httpRes.GetResponseStream();
Can anyone please spot out the mistake in this code.
Thanks