【问题标题】:Serialization exception in wcf servicewcf 服务中的序列化异常
【发布时间】:2014-08-05 17:26:24
【问题描述】:

我们有一个包含一些方法的 wcf 服务,当它尝试序列化数据时偶尔会失败。异常如下(还包含堆栈跟踪)。

有什么解决办法吗? 另外,为什么这种情况并非一直偶尔发生?返回的数据始终保持不变。

[System.Text.EncoderFallbackException]:无法将索引 1 处的 Unicode 字符 \uDF98 转换为指定的代码页。 调用栈: 在 System.Text.EncoderExceptionFallbackBuffer.Fallback(System.Char charUnknown,System.Int32 索引) [IL: 0x2B][Native: 0xB7] 在 System.Text.EncoderFallbackBuffer.InternalFallback(System.Char ch,System.Char*& 字符) [IL: 0xE7][Native: 0x125] 在 System.Text.UTF8Encoding.GetBytes(System.Char* chars,System.Int32 charCount,System.Byte* bytes,System.Int32 byteCount,System.Text.EncoderNLS baseEncoder) [IL: 0x21D][Native: 0xD93D94] 在 System.Text.UTF8Encoding.GetBytes(System.Char* chars,System.Int32 charCount,System.Byte* bytes,System.Int32 byteCount) [IL: 0x54][Native: 0x4C] 在 System.Xml.XmlStreamNodeWriter.UnsafeGetUTF8Chars(System.Char* chars,System.Int32 charCount,System.Byte[] 缓冲区,System.Int32 偏移量) [IL: 0x80][Native: 0x263CC3] 在 System.Xml.XmlBinaryNodeWriter.UnsafeWriteText(System.Char* chars,System.Int32 charCount) [IL: 0x3C][Native: 0x8B] 在 System.Xml.XmlBinaryNodeWriter.WriteText(System.String 值)[IL:0x39][Native:0x3C] 在 System.Xml.XmlBaseWriter.WriteString(System.String 值) [IL: 0x4D][Native: 0x9E] 在 System.Runtime.Serialization.XmlObjectSerializerWriteContext.WriteString(System.Runtime.Serialization.XmlWriterDelegator xmlWriter,System.String 值,System.Xml.XmlDictionaryString 名称,System.Xml.XmlDictionaryString ns)[IL:0x29][Native:0x53] 在 WriteArrayOfstringToXml(System.Runtime.Serialization.XmlWriterDelegator ,System.Object ,System.Runtime.Serialization.XmlObjectSerializerWriteContext ,System.Runtime.Serialization.CollectionDataContract )[Native: 0xDC]

【问题讨论】:

    标签: .net wcf serialization


    【解决方案1】:
    猜你喜欢
    • 2011-05-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-10-22
    • 2017-06-13
    • 1970-01-01
    • 2010-12-28
    • 2010-12-17
    相关资源
    最近更新 更多