Last post Jun 30, 2012 10:41 PM by GMann
Jun 29, 2012 12:55 PM|GMann|LINK
I made an update to a web handler which is currently used in production.
The updated version has been deployed on a test server (2008) and I am having problems
getting the handler to respond.
In my test app when I connect a get a "null" response.
The problem is not getting enough feedback from asp.net on why null is returned by the web response.
I am using a trace to get the response and this gives a very generic message.
My test app sends the contents of an xml file to the handler which "echos" the contents to a textbox on a web page.
So there are no errors just a null response.
This same test code works when I connect to the production web handler on my local machine
Is there a way to see any more details on the response ?
Thanks for any insights !
Here is my code -
WebRequest req = null;
WebResponse rsp = null;
String uri = "some ip";
req = WebRequest.Create(uri);
req.Method = "POST"; // Post method
req.ContentType = "text/xml"; // content type
StreamWriter writer = new StreamWriter(req.GetRequestStream());
StreamReader reader = new StreamReader(Server.MapPath("~/Test.xml"));
string ret = reader.ReadToEnd();
rsp = req.GetResponse();
StreamReader sr = new StreamReader(rsp.GetResponseStream());
string responseString = sr.ReadToEnd();
TextBox1.Text = responseString;
catch (WebException webEx)
Trace.Write("From Web: " + webEx.Message);
catch (Exception ex)
Trace.Write("From System: " + ex.Message);
if (req != null) req.GetRequestStream().Close();
if (rsp != null) rsp.GetResponseStream().Close();
Jun 29, 2012 01:16 PM|Mudasir.Khan|LINK
try changing the url and get the response and see if that server is not accepting it
Jun 29, 2012 01:36 PM|GMann|LINK
I can change my uri to the production site and I get a response.
Could this be due to a setting in IIS.
Although I did compare production to test IIS settings and the look the same.
I have made the necessary firewall changes to allow database and remote responses.
Jun 30, 2012 10:41 PM|GMann|LINK
Would using a tool like fidler help me diagnoise my problem ?
I don't get a response when running the app on the test server as localHost could some tool like fiddler work on the server ?