0 Replies - 4394 Views - Last Post: 14 May 2007 - 08:20 AM Rate Topic: -----

#1 pavankondepudi  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 14-May 07

Problem with HttpWebRequest and HttpWebResponse

Posted 14 May 2007 - 08:20 AM

Hello- here is my code, where I use HttpWebRequest and Webresponse:
localUrl =
string.Format("{0}HtmlGenerator.aspx?image={1}", Request.Url.AbsoluteUri.Substring(0, index),
localUrl.Remove(4, 1);

HttpWebRequest req = (HttpWebRequest)WebRequest.Create(localUrl);
HttpWebResponse resp= (HttpWebResponse)req.GetResponse();
using (StreamReader sr = new StreamReader(resp.GetResponseStream()))
html = sr.ReadToEnd();

I ran this code in 3 environments : my local machine, a development server and a test server.

This code works well on my local machine, dev server but breaks on test slot.
I get this error " The underlying connection was closed: Could not establish trust relationship with remote server"
When I started debugging on the test slot, looks like when my code makes a webrequest call to the other page (Page url is stored in localUrl variable) that variable flips to null.
But it doesnt happen on my local box or on the dev slot, its only with test slot.
Any ideas?? Is it something to do with the server configuration?? Is there a way I could rewrite my code, to make my app working on test slot???

Is This A Good Question/Topic? 0
  • +

Page 1 of 1