473,406 Members | 2,369 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

getting an error in receiving WebResponse

hi All,
I have written the following code to get a webresponse.
Expand|Select|Wrap|Line Numbers
  1. XmlDocument myxmlDoc1 = new XmlDocument();
  2. myxmlDoc1.LoadXml(BkXMLRQ);
  3.  
  4. string s = myxmlDoc1.OuterXml;
  5. System.Text.ASCIIEncoding encoding1 = new System.Text.ASCIIEncoding();
  6. Byte[] byt1 = encoding.GetBytes(myxmlDoc1.OuterXml);
  7.  
  8. WebRequest httpRQ = WebRequest.Create(InterfaceURL);
  9. httpRQ.ContentType = "text/xml";
  10. httpRQ.ContentLength = BkXMLRQ.Length;
  11. httpRQ.Method = "POST";
  12. //httpRQ.Timeout = 90000;
  13.  
  14. System.IO.Stream ioStream1 = httpRQ.GetRequestStream();
  15. ioStream1.Write(byt1, 0, byt1.Length);
  16.  
  17. //It Gets Stuck Here
  18. WebResponse httpRes = httpRQ.GetResponse();
  19. System.IO.Stream ResStream1 = httpRes.GetResponseStream();
  20.  
the execuion gets stuck at "WebResponse httpRes = httpRQ.GetResponse();". 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
Jan 27 '09 #1
0 1094

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Jonathan | last post by:
Calling the System.Net.WebResponse.GetResponse method (see code below) results in the following error: System.Net.WebException: The underlying connection was closed: An unexpected error occurred...
2
by: Jonax | last post by:
Hi guys, I have the following code that retrieves a webpage. My problem is getting it to use the right encoding. I've tested it against a danish page, but it won't show the danish characters....
2
by: Jon Maz | last post by:
Hi All, I am using a WebRequest & WebResponse to GET the contents of an aspx page as a string (code below). It's working fine, except that when the aspx page has an error on it, I want to...
1
by: Jacob | last post by:
Please help figure what I am doing wrong in this code. All I am trying to do is send come data to an aspx page and get some data back. I watched my variable in debug mode and can tell that I am...
0
by: TCook | last post by:
Hello, I am trying to programmatically post (i.e. login, redirect & programmatically submit data) to a website not a webservice. I am receiving the error that is shown in the subject line of...
1
by: Mad Scientist Jr | last post by:
For some reason I can't get a WebClient to access an outside URL from behind our firewall. The code works when it runs outside the firewall. I turned on windows authentication in the web.config...
3
by: Jeremy Chapman | last post by:
I've writtin a very simple web service in axis which returns an array of classes. I consume it in a .net app. When receiving the response, my .net app generates an error "Cannot assign object...
2
by: Jerry Spence1 | last post by:
I am trying to come up with a focussing routine for a camera and I need to detect when the image is in focus. As I understand it, JPG Image size goes up sharply when it is in focus as it is very...
4
by: imaloner | last post by:
I am posting two threads because I have two different problems, but both have the same background information. Common Background Information: I am trying to rebuild code for a working,...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.