xml - strip - 使用 xml /xsd 文件解决 dtd 错误 SSIS
问题描述
我编写了一个使用 xml 源(另存为 .XSD)的 SSIS 包
我制作了一个普通包,它只是从 HTTP 网站带回了国家/地区的数据
我拥有的是 HTTPS,因此我收到 DTD 错误。
由于它是 HTTPS,我不知道如何修改我的脚本任务来验证用户名和密码。我只是基本的 SSIS 。请参阅 1. 编码,我自己正在尝试目前// out。
是另存为的 XML 文件和 XSD 文件类型,代码如下。我可以在 xml 代码中添加什么来停止 DTD 错误
公共无效主要(){
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">
解决方案
推荐阅读
- java - LDAP 是否在 ActiveDirectory 环境中工作?
- oracle - Spring Batch JpaPagingItemReader:如何设置查询提示?
- java - rsyslog 多行事件 java 堆栈跟踪发送到 tcp 侦听器
- hadoop - 你如何将oracle表导入hive表
- elasticsearch - Elasticsearch 多前缀查询或匹配
- javascript - 从反应应用程序中的字符串创建下拉列表选项
- c++ - 在向量 C++14 中的结构内的联合中创建和存储字符串(无限制联合)
- php - 连接查询中的列以使用“LIKE”运算符
- xml - 根据 XSD 中的属性值限制元素的出现次数可能吗?
- c - 在 C 中创建矩阵微分方程