from: jezza at pobox.com
==============
1. Do not use ProtoContract or ProtoMember attributes on data contract
2. Use DataContract and DataMember with a single property where DataMember has
Order=0, IsRequired=true for that property
3. Use ProtoBehaviorExtension as the behavior extension for the endpoint - i.e.
no code changes to support ProtoBuf at all, purely configuration based
You will find that the data contract is not populated between request /
response. It works fine if I set Order=1, but Order=0 is perfectly valid and
quite standard practice for the first member. To test, I used the following
(data contracts and service contract are in a separate DLL shared by both
client and server):
[DataContract]
public class CalcType
{
[DataMember(Order = 0, IsRequired = true)]
public virtual int Number { get; set; }
}
[ServiceContract]
public interface ICalculator
{
[OperationContract]
CalcType Calculate(CalcType type1, CalcType type2);
}
Version is 2.0.0.480
OS is Windows 7 Enterprise SP1 (64-bit)
Original issue reported on code.google.com by jpe...@gmail.com on 25 Oct 2012 at 1:13
Original issue reported on code.google.com by
jpe...@gmail.com
on 25 Oct 2012 at 1:13