SvcUtil Problem

I have class that is defined as Data Contract .

After SvcUtil Generate proxy all memeber define as ExtensionDataObject.

The Code before use in svcutil

[DataContract]

[KnownType(typeof(IntArray))]

public class CUserServerInfo

{

public string m_ServerName;

public IntArray m_ArrayChannelPermission;

public IntArray m_ArrayOperationPermission;

}

[DataContract]

public class IntArray

{

public int[] m_IntArray;

}

And the code after use in SvcUtil

[System.Runtime.Serialization.DataContractAttribute()]
public partial class CUserServerInfo : object, System.Runtime.Serialization.IExtensibleDataObject
{

private System.Runtime.Serialization.ExtensionDataObject extensionDataField;

public System.Runtime.Serialization.ExtensionDataObject ExtensionData
{
get
{
return this.extensionDataField;
}
set
{
this.extensionDataField = value;
}
}
}
}

why svcutil generate all member as ExtensionDataObject and how i can to solve this .




Answer this question

SvcUtil Problem

  • sl wong

    yes thank you i forget to define [DataMember]

    before member.

    After i added ,this solved the problem.

    Thanks .



  • FerNava

    Hi,

    Try to place [DataMember] attribute above your data members and try again. Using DataContract may not be enogh.

    Guy Burstein

    http://blogs.microsoft.co.il/blogs/bursteg/



  • SvcUtil Problem