I've updated an existing WCF application to add protobuf-net support. Basically, I've :
added protobuf-net.dll (.net 3.0) as a reference in the assembly containing all my data objects. This assembly is referenced by both my server and my client
replaced [DataMember] by [DataMember(Order = x)] (using increasing ints as x)
Updated all my OperationContracts with the ProtoBehavior attribute
Updated my service reference
From the client, I call this method on the server :
[OperationContract(IsOneWay = false), ProtoBehavior]
ConnectionData Join(string userId, string Password);
with ConnectionData being defined like this :
[DataContract]
public class ConnectionData
{
[DataMember(Order = 1)]
public ConnectionStatusEnum ConnectionStatus; // this is a normal enum with five elements
// .....
[DataMember(Order = 5)]
public bool MustChangePassword;
}
Now, here's what's going on :
If I debug the server, I see that a ConnectionData object is correctly initialized and returned in the Join method
If I debug the client, I see a null object being returned from my Join call
I've enabled WCF tracing to the maximum verbosity, nothing caught my eye in the Server's log, but in the Client log file I've seen this warning message :
System.Runtime.Serialization.ElementIgnored
An unrecognized element was encountered in the XML during deserialization which was ignored.
Element http://tempuri.org/%3Aproto
I've sniffed my network trafic, and I don't blame protobuf-net for not being able to deserialize this :
<s:Body><JoinResponse xmlns="http://tempuri.org/"><proto/></JoinResponse></s:Body>
How can I further troubleshoot the problem and get protobuf-net to serialize my messages correctly?
I'm using protobuf-net r275