I have a web service in which I pass in a string which is the string representation of the xml of a DataSet. It is important for me to pass it as a string. This data can be quite large (a few megabytes sometimes) I want to compress it. I set up my web-service and my consumer to use the ICSharpCode.SharpZipLib.
My problem is that the "compressed string" representation contains characters which the web service doesn't like. I get errors like:
System.Xml.XmlException: '', hexadecimal value 0x1C, is an invalid character. Line 6, position 117.
at System.Xml.XmlScanner.Scan
HexEntity(
)
at System.Xml.XmlTextReader.P
arseBeginT
agExpandCh
arEntities
()
at System.Xml.XmlTextReader.R
ead()
at System.Xml.XmlReader.ReadE
lementStri
ng()
Sometimes it is a different character, so obviously this is from the compression algorithm.
How can I send a compressed string to a web-service and then decompress it? I think the code is probably "right" because I am apparently sending a compressed string. I'm not sure what to do, I am using ASCIIEncoding.
Start Free Trial