Trying to get this to work, with no luck:
[DataMember]
public Type ParameterType { get; set;}
Gets or sets a value that specifies whether to serialize the default value for a field or property being serialized.
Data Member are the fields or properties of your Data Contract class. You must specify [DataMember] attribute on the property or the field of your Data Contract class to identify it as a Data Member. DataContractSerializer will serialize only those members, which are annotated by [DataMemeber] attribute.
The KnownTypeAttribute class allows you to specify, in advance, the types that should be included for consideration during deserialization.
DataContact. A datacontract is a formal agreement between a client and service that abstractly describes the data to be exchanged. In WCF, the most common way of serialization is to make the type with the datacontract attribute and each member as datamember. Creating a basic DataContract and DataMember.
Web Services, in general, are meant to be cross-platform. What would a Java program do with a System.Type from .NET?
Also, what part of Type would you like to see serialized, and how would you like to see it deserialized?
Any field or property that returns System.Type
is not serializable using WCF because, at runtime, the actual type of the object is System.RuntimeType
, which is marked as internal, and thus cannot be automatically serialized by the DataContractSerializer
, which can only serialize publicly accessible types.
However, you could write an IXmlSerializer
wrapper around System.Type
that will pull out the information you intend to transfer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With