tags:

views:

66

answers:

3

Hi ,

I am writing code in asp.net to get XML data from external webserver.

*.cs Code

connection string: URL of external(third party) server for XML data

 WebRequest req = WebRequest.Create(connectionString);
                req.Proxy = WebProxy.GetDefaultProxy();
                req.Proxy.Credentials = CredentialCache.DefaultCredentials;
                req.Timeout = 1000;
                using (WebResponse resp = req.GetResponse())
                {
                   // reading data from XML file
                }

Key Point 1. GetDefaultProxy() return information about proxy 2. Default Credentials() return username password which i have written in web.config as shown below

Web.config

    <identity impersonate="true" 
username="Username of PC where website is running" 
password="password"/>

Problem Statement: After installing website setup : Above code working fine at WindowsXP but the same code doesn't work at Windows server 2003. I am not able to find out what extra we need to configure in Windows Server 2003.

Please help me to find out the solution?

[EDIT]

Very random beheviour is observed at server. Sometimes the data comes and appear at client(browser) when we logged into windows server 2003. But when we loggedout from server and try to request for data from client(browser) at another PC. It appear for very short duration. After say wait of 1 hour the data doesn't comes for new request.

A: 

An error message might be useful??

But at a guess I'd say it's that the proxy isn't configured on the 2003 server.

wefwfwefwe
Please read my more observation. I don't know why it happen
Hemant Kothiyal
A: 

Check the firewall on Windows Server 2003 and make sure port 80 outbound is allowed (assuming that is the port used by the web service).

RedFilter
Please read my more observation. I don't know why it happen
Hemant Kothiyal
A: 

This might help. It's about proxy and .NET app.

Viktor Jevdokimov