【问题标题】:SSIS Script Transformation Error The remote server returned an error: (407) Proxy Authentication RequiredSSIS 脚本转换错误远程服务器返回错误:(407) 需要代理身份验证
【发布时间】:2021-12-18 21:17:50
【问题描述】:

我正在使用 SQL Server 和 Visual Studio 2019。我有一个 SSIS 包,它使用脚本转换作为从 Web 服务中提取数据的源 (c#)。当我在笔记本电脑上通过 Visual Studio 执行时,它都可以 100% 运行。当我部署到 SSIS 目录并执行时,我不断收到错误消息:

Error The remote server returned an error: (407) Proxy Authentication Required

这是我的代码的 sn-p:

public class ScriptMain : UserComponent
{
    string json;
    DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);

    public override void PreExecute()
    {
        base.PreExecute();
        ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;
        
        string fullurl = Variables.FullURL;

        string url = fullurl;

        json = DownloadJson(url);
    }

我正在使用包含所有登录名和密码信息的变量(上面的 fullurl)构建 url。我需要修改它还是公司网络上的某些东西阻止了它?

【问题讨论】:

  • 运行 SSIS 包的 SQL Server 帐户似乎无法通过贵公司的防火墙/代理服务器访问。
  • 谢谢,可能是这样

标签: c# json sql-server web-services ssis


【解决方案1】:

身份验证的方式很少出现在查询字符串中。可以,但通常不是。

试试这个...

var wc = new System.Net.WebClient();
wc.Credential = new NetworkCredential([username],[password]);
string json = wc.DownLoadString(url);

在 PreExecute 部分执行此操作也很不寻常。您通常在脚本组件源的添加行部分执行此操作。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-11-22
    相关资源
    最近更新 更多