Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/oop/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql server SSIS Web服务任务返回一个带有“0”的文件&;lt&引用&;lt/价值及;燃气轮机;人物_Sql Server_Xml_Ssis_Etl_Ssis 2008 - Fatal编程技术网

Sql server SSIS Web服务任务返回一个带有“0”的文件&;lt&引用&;lt/价值及;燃气轮机;人物

Sql server SSIS Web服务任务返回一个带有“0”的文件&;lt&引用&;lt/价值及;燃气轮机;人物,sql-server,xml,ssis,etl,ssis-2008,Sql Server,Xml,Ssis,Etl,Ssis 2008,我有一个简单的ssis包,它将web服务方法的结果保存到XML文件中。 连接正常,正在创建文件,但包含和标记,而不是 如何替换此标签以更正错误 主要问题是,您将xml作为字符串从web服务传递(不推荐) 您必须更改web方法以返回XmlDocument,将格式良好的xml加载到其中,并将其传回SSIS 或者,您可以做一点变通,即在保存xml文件后运行脚本,并将替换为 有用的链接 也是一种选择 Dim fileFirst As String = Dts.Variables("Us

我有一个简单的ssis包,它将web服务方法的结果保存到XML文件中。 连接正常,正在创建文件,但包含
标记,而不是


如何替换此标签以更正错误

主要问题是,您将xml作为字符串从web服务传递(不推荐)

您必须更改web方法以返回
XmlDocument
,将格式良好的xml加载到其中,并将其传回SSIS

或者,您可以做一点变通,即在保存xml文件后运行脚本,并将
替换为

有用的链接

也是一种选择

    Dim fileFirst As String = Dts.Variables("User::FullFilePath").Value.ToString()
    File.WriteAllText(fileFirst, File.ReadAllText(fileFirst).Replace("&lt;", "<"))

    Dim fileSecond As String = Dts.Variables("User::FullFilePath").Value.ToString()
    File.WriteAllText(fileSecond, File.ReadAllText(fileSecond).Replace("&gt;", ">"))

    Dim fileThird As String = Dts.Variables("User::FullFilePath").Value.ToString()
    File.WriteAllText(fileThird, File.ReadAllText(fileThird).Replace("&amp;", "&"))

    Dim fileFour As String = Dts.Variables("User::FullFilePath").Value.ToString()
    File.WriteAllText(fileFour, File.ReadAllText(fileFour).Replace("&quot;", "\"))

    Dim fileFive As String = Dts.Variables("User::FullFilePath").Value.ToString()
    File.WriteAllText(fileFive, File.ReadAllText(fileFive).Replace("&apos;", "'"))
Dim fileFirst As String=Dts.Variables(“User::FullFilePath”).Value.ToString()
File.WriteAllText(fileFirst,File.ReadAllText(fileFirst).Replace(“,”))
Dim fileThird As String=Dts.Variables(“User::FullFilePath”).Value.ToString()
File.WriteAllText(fileThird,File.ReadAllText(fileThird).Replace(“&;”,“&”))
Dim fileFour As String=Dts.Variables(“User::FullFilePath”).Value.ToString()
File.WriteAllText(fileFour,File.ReadAllText(fileFour).Replace(“”,“\”)
Dim fileFive As String=Dts.Variables(“User::FullFilePath”).Value.ToString()
File.WriteAllText(fileFive,File.ReadAllText(fileFive).Replace(“&apos;”,“'))

使用Script task->VB

可以添加更多详细信息吗?也许是一个软件包的截图Hank you Hadi,我对这个方法很感兴趣:。如果您能在这里提供一些示例,那就太好了。