Windows Server 2008下载无法连接到远程服务器

时间:2015-10-20 03:30:22

标签: c# .net ssis windows-server-2008 webclient

我正从服务器下载xml文件。这是一个使用VS2008的SSIS项目。它在本地计算机上工作正常,但当我在服务器中使用相同的代码时。我收到了一个错误。 Unable to connect to the remote server

这是我下载文件的代码。 Url有用户名和密码。

  string url = "https://test.openseas.wlcl.com.au:8888/cruise/PA/priceSummary?AgentId=DIRECTAU&format=xml";
  WebClient mySSISWebClient = new WebClient();

  mySSISWebClient.Credentials = new NetworkCredential();
  mySSISWebClient.Credentials = new NetworkCredential("username", "password");
  ServicePointManager.ServerCertificateValidationCallback += (sender, certificate, chain, sslPolicyErrors) => true;
  mySSISWebClient.Encoding = Encoding.Unicode;

  // To save the file (and replace the existing file)
  mySSISWebClient.DownloadFile(url , Dts.Variables["User::LocalSourceFile"].Value.ToString());

上面的代码在本地工作正常,但在服务器中却没有。任何人都可以帮助我为什么它不在服务器上工作。这是防火墙问题,因为如果我只是在浏览器上键入URL(https://test.openseas.wlcl.com.au:8888/cruise/PA/priceSummary?AgentId=DIRECTAU&format=xml),我就会收到错误消息。 this connection is untrusted。任何人都可以帮助我,这将是非常好的。

提前致谢

0 个答案:

没有答案