首页 > 解决方案 > strip - 使用 xml /xsd 文件解决 dtd 错误 SSIS

问题描述

我编写了一个使用 xml 源(另存为 .XSD)的 SSIS 包

我制作了一个普通包,它只是从 HTTP 网站带回了国家/地区的数据

我拥有的是 HTTPS,因此我收到 DTD 错误。

  1. 由于它是 HTTPS,我不知道如何修改我的脚本任务来验证用户名和密码。我只是基本的 SSIS 。请参阅 1. 编码,我自己正在尝试目前// out。

  2. 是另存为的 XML 文件和 XSD 文件类型,代码如下。我可以在 xml 代码中添加什么来停止 DTD 错误

    1. 公共无效主要(){

      string xmlDoc = String.Empty;
      
      try
      {
          // Get the URL from the variable
          string url = Dts.Variables["User::URL"].Value.ToString();
          // Get the Email from the variable
          // string Email = Dts.Variables["User::username"].Value.ToString();
         // Get the Password from the variable
         //string Password = Dts.Variables["User::Password"].Value.ToString();
      
          //Create a Web Client
          using (WebClient client = new WebClient())
          {
              //Download the xml document as a string
              xmlDoc = client.DownloadString(url);
          }
      
          // Set the value of the xmlDocument to the string that was just downloaded
          Dts.Variables["User::xmlDoc"].Value = xmlDoc;
      
          Dts.TaskResult = (int)ScriptResults.Success;
      }
      catch
      {
          Dts.TaskResult = (int)ScriptResults.Failure;
      }
      }
      

    请帮忙 2。

    这是我的 xml 文档的开头..另存为 xsd

    <?xml version="1.0" encoding="UTF-8" ?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    
    <xs:element name="events">
    

标签: xmlssisxsdssis-2012

解决方案


推荐阅读