ข้อยกเว้นการทำให้เป็นอนุกรมในบริการ wcf

เรามีบริการ wcf ที่มีวิธีการบางอย่าง และบางครั้งก็ล้มเหลวเมื่อพยายามทำให้ข้อมูลเป็นอนุกรม มีข้อยกเว้นอยู่ด้านล่าง (ยังมีการติดตามสแต็กด้วย)

มีวิธีแก้ปัญหาสำหรับเรื่องนี้ไหม? นอกจากนี้ ทำไมสิ่งนี้ถึงเกิดขึ้นเป็นระยะๆ ไม่ใช่ตลอดเวลา ? ข้อมูลที่ส่งคืนจะยังคงเหมือนเดิมตลอดเวลา

[System.Text.EncoderFallbackException]: ไม่สามารถแปลอักขระ Unicode ��� ที่ดัชนี 1 เป็นโค้ดเพจที่ระบุ CallStack: ที่ System.Text.EncoderExceptionFallbackBuffer.Fallback (System.Char charUnknown ดัชนี System.Int32) [IL: 0x2B] [เนทีฟ: 0xB7] ที่ System.Text.EncoderFallbackBuffer.InternalFallback (System.Char ch, System.Char * & ตัวอักษร) [IL: 0xE7][เนทีฟ: 0x125] ที่ System.Text.UTF8Encoding.GetBytes(System.Char* chars,System.Int32 charCount,System.Byte* bytes,System.Int32 byteCount,System.Text.EncoderNLS baseEncoder) [IL: 0x21D] [เนทีฟ: 0xD93D94] ที่ System.Text.UTF8Encoding.GetBytes (อักขระ System.Char *, System.Int32 charCount, System.Byte* ไบต์, System.Int32 byteCount) [IL: 0x54] [เนทีฟ: 0x4C ] ที่ System.Xml.XmlStreamNodeWriter.UnsafeGetUTF8Chars (อักขระ System.Char*, System.Int32 charCount, System.Byte[] buffer, System.Int32 offset) [IL: 0x80][Native: 0x263CC3] ที่ System.Xml.XmlBinaryNodeWriter UnsafeWriteText (อักขระ System.Char *, 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] [ดั้งเดิม: 0x9E] ใน System.Runtime.Serialization.XmlObjectSerializerWriteContext.WriteString (System.Runtime.Serialization.XmlWriterDelegator xmlWriter ค่า System.String, System.Xml ชื่อ XmlDictionaryString System.Xml.XmlDictionaryString ns) [IL: 0x29] [ดั้งเดิม: 0x53] ที่ WriteArrayOfstringToXml (System.Runtime.Serialization.XmlWriterDelegator , System.Object , System.Runtime.Serialization.XmlObjectSerializerWriteContext , System.Runtime.Serialization.CollectionDataContract )[เนทิฟ: 0xDC]


person Prashanth R    schedule 05.08.2014    source แหล่งที่มา


คำตอบ (1)


โปรดตรวจสอบ URL ด้านล่าง อาจช่วยคุณในเรื่องข้อยกเว้นนี้ได้

http://social.msdn.microsoft.com/Forums/vstudio/en-US/063579c4-f0ed-465a-acb1-d72a84e6b3fb/encoderfallbackException-on-binaryencoder-tcp?forum=wcf

person Vinod Kumar    schedule 06.08.2014