I have a simple ssis package what saves result from web service method to XML file.
Connection OK, file creating, but contains <
and >
tags instead of <
and >
.
Asked
Active
Viewed 889 times
2
-
can you add more details? maybe a screenshot of the package – Hadi Apr 08 '17 at 13:37
2 Answers
1
The main issue is that you are passing the xml from the web service as a string (Not recommended)
you have to change the web method to return an XmlDocument
, load the well-formed xml into it, and passed it back SSIS.
Or you can do a little workaround is to run a script after saving the xml file and replace <
with <
and >
with >
Useful Links
-
Thank You Hadi, I interesting in this method: http://stackoverflow.com/questions/5006020/decode-xml-returned-by-a-webservice-and-are-replaced-with-lt-and-gt . Would be great if you can provide some example here. – Key Apr 08 '17 at 15:27
0
Also one of options
Dim fileFirst As String = Dts.Variables("User::FullFilePath").Value.ToString()
File.WriteAllText(fileFirst, File.ReadAllText(fileFirst).Replace("<", "<"))
Dim fileSecond As String = Dts.Variables("User::FullFilePath").Value.ToString()
File.WriteAllText(fileSecond, File.ReadAllText(fileSecond).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("'", "'"))
using Script task -> VB

Key
- 71
- 1
- 9