2011-02-14 5 views
0
<s:Body> 
<s:Fault> 
    <s:Code> 
    <s:Value>s:Sender</s:Value> 
    <s:Subcode> 
     <s:Value xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:DeserializationFailed</s:Value> 
    </s:Subcode> 
    </s:Code> 
    <s:Reason> 
    <s:Text xml:lang="en-US">The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://tempuri.org/:dataSet. The InnerException message was 'There was an error deserializing the object of type System.Data.DataSet. '��&lt;http://tempuri.org/ISplSynchronizationContracts/ApplyChangesD&#x1A;' contains invalid UTF8 bytes.'. Please see InnerException for more details.</s:Text> 
    </s:Reason> 
    <s:Detail> 
    <ExceptionDetail xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/System.ServiceModel"> 
     <HelpLink i:nil="true" /> 
     <InnerException> 
     <HelpLink i:nil="true" /> 
     <InnerException> 
      <HelpLink i:nil="true" /> 
      <InnerException> 
      <HelpLink i:nil="true" /> 
      <InnerException i:nil="true" /> 
      <Message>Unable to translate bytes [82] at index 0 from specified code page to Unicode.</Message> 
      <StackTrace> at System.Text.DecoderExceptionFallbackBuffer.Throw(Byte[] bytesUnknown, Int32 index) 
    at System.Text.DecoderExceptionFallbackBuffer.Fallback(Byte[] bytesUnknown, Int32 index) 
    at System.Text.DecoderFallbackBuffer.InternalFallback(Byte[] bytes, Byte* pBytes, Char*&amp; chars) 

J'utilise la liaison personnalisée dans WCF et parfois obtenir l'erreur ci-dessus. Quelqu'un peut-il m'aider?WCF throw exception

+2

Que fait votre fixation custum? –

+0

Compression et chiffrement. –

Répondre

0

L'exception contient le texte: contains invalid UTF8 bytes

Il est difficile de vérifier en fonction du contexte limité, mais je suppose que quelque part le long de la ligne, vous sérialisation UTF-16 ou un autre format, et le service échoue à cela.

Assurez-vous que tous les objets en sérialisation sont explicitement sérialisés à l'aide de UTF-8.

+0

J'utilise les services de synchronisation Microsoft Ado.Net sur les services WCF. L'objet de jeu de données est transmis en interne par les services de synchronisation. –

Questions connexes