2011-03-09 77 views
0

有一个使用SOAP跨Web服务发布XML数据的应用程序。发送SOAP请求时奇怪的XML异常

数据直接从Oracle数据库中提取并解析为XML,但出于某种原因,从数据库中提取的数据抛出以下无效的XML异常。

已经做了一些研究,看起来它可能是XML分析器不喜欢的数据中的某个NULL字符。

只是想知道如果有人曾经见过这个,如果是的话,他们能够修复它在应用程序或数据库层?

谢谢!

这里的堆栈跟踪...

异常System.Xml.XmlException: '',十六进制值为0x00,是一个无效字符。第1行,位置79763. at System.Xml.XmlTextReaderImpl.Throw(Exception e) at System.Xml.XmlTextReaderImpl.Throw(String res,String [] args) at System.Xml.XmlTextReaderImpl.Throw(Int32 pos,串资源,字串[] args) 在System.Xml.XmlTextReaderImpl.ThrowInvalidChar(POS的Int32,CHAR invChar) 在System.Xml.XmlTextReaderImpl.ParseNumericCharRefInline(的Int32 startPos,布尔扩大,BufferBuilder internalSubsetBuilder,的Int32 & charCount,的EntityType &的EntityType ) 在System.Xml.XmlTextReaderImpl.ParseText(的Int32 & startPos,的Int32 & endPos,的Int32 & outOrChars) 在System.Xml.XmlTextReaderImpl.ParseText() 在System.Xml.XmlTextReaderImpl.ParseElementContent() 在System.Xml.XmlTextReaderImpl.Read() 在System.Xml.XmlTextReader.Read() 在System.Xml.XmlValidatingReaderImpl.Read() 在的System.Xml。 XmlValidatingReader.Read() 在System.Xml.XmlLoader.LoadNode(布尔skipOverWhitespace) 在System.Xml.XmlLoader.LoadDocSequence(XmlDocument的parentDoc) 在System.Xml.XmlLoader.Load(XmlDocument的文档,读取器的XmlReader,布尔preserveWhitespace) (XmlReader读者) at Microsoft.Web.Services2.Security.MessageSignature.PreProcessElementInput(XmlElement elem) at Microsoft.Web.Services2.Security.SignatureReference.CalculateHashValue(XmlDocument document, CanonicalXmlNodeList refList) 在Microsoft.Web.Services2.Security.MessageSignature.BuildDigestedReferences() 在Microsoft.Web.Services2.Security.MessageSignature.ComputeKeyedHashSignature(SymmetricKeyAlgorithm键) 在Microsoft.Web.Services2.Security.MessageSignature.ComputeSignature() 在Microsoft.Web.Services2.Security.Security.SerializeXml(的SoapEnvelope文件) 在Microsoft.Web.Services2.Security.SecurityOutputFilter.ProcessHeader(安全保障,信封的SoapEnvelope) 在Microsoft.Web.Services2.Security.SecurityOutputFilter.ProcessMessage (SoapEnvelope envelope) at Microsoft.Web.Services2.Pipeline.ProcessOutputMessage(SoapEnvelope envelope) at Microsoft.Web.Services2.OutputStream.Close() at Syste m.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(字符串方法名,对象[]参数)

UPDATE:这里是被published.Just纯文本的选择数据的基本上,这是它存在于数据库中的列,都以逗号分隔。

614494,2003,33,327,15961,59652,2,2,3,2,1,10日 - 12月08,MY2003 AERO轿车,手动2.0

+0

这是刚刚从数据库中获得的原始XML,然后通过Web服务返回?如果是这样,你是否尝试从数据库输出创建一个XmlDocument,然后返回解析结果(或通过XmlReader/XmlWriter)? – rsbarro 2011-03-09 06:08:43

回答

0

,您在拉什么样的数据甲骨文?一个博客?图像blob?

我问的原因是图像有标题,这意味着标题后面会有空字符。不知道如何逃避空字符,但是,使其有效的序列化,但你可以做一些像base64编码图像,这将扭转另一端base64转换。

除此之外,您应该发布您从Oracle提取的确切数据,因为这可能有助于获得更具体的答案。

+0

已更新数据的问题...谢谢:) – timothyclifford 2011-03-09 04:30:21