getting an error in receiving WebResponse

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • deeps1512
    New Member
    • Jan 2009
    • 1

    getting an error in receiving WebResponse

    hi All,
    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();
    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
    Last edited by Frinavale; Jan 27 '09, 04:57 PM. Reason: added [code] tags
Working...