Welcome to MSDN Blogs Sign in | Join | Help

Browse by Tags

All Tags » Serialization » Indigo » Answers   (RSS)

No Choice for Data Contracts

I have a schema file that describes a choice between multiple layout formats for a type. How do I build a proxy that matches this schema? The reason that this is probably not working is because DataContractSerializer for the most part does not support

Serializing XML to XML

How should I represent raw XML content in a contract? It seems like it would be really easy to have within the large blob of XML that makes up a message, a small blob of XML. However, it's more challenging to deal with that situation than you might expect

Generating Types with Lists

I have a data contract that contains a collection type but the generated proxy appears as an array. How can I make the proxy use a collection type as well? I've talked in the past about how the representation of a type in metadata is decoupled from the

Private Data Members

Why does a data contract with private or internal members generate a proxy with public fields? The obvious answer is that the representation for data contracts doesn't contain information about member visibility but that just leads to the question of

One Shot Serialization

Why do some serialization errors when sending a response not result in a fault being returned to the client? In the typical service operation, sending a response is comprised of returning the appropriate information from the service method to construct

Differences in Enum Serialization

Why does adding an enum parameter to an operation cause the proxy to explode into message contracts? This was a question asking why the following perfectly ordinary operation contract caused svcutil.exe to spit out some really ugly code. [OperationContract]

Producing Typed Messages

How do typed messages get created from an object that has a message contract? There seem to be a lot of examples that talk about how messages get produced when they're described by data contracts but relatively few descriptions of the equivalent process

Differences in Guid Serialization

Why do the guids in my contract turn into strings when generating a client? You're probably mixing different types of serializers between the client and service. There's nothing wrong with this and the generated client will work correctly but you don't

Collections without CollectionDataContract

In the article about serialization conflicts , one of the points mentioned was that CollectionDataContract doesn't let you add non-default data members. How do I format a collection that contains data members? CollectionDataContract is automatically being

Resolving Conflicts in Serialization

DataContractSerializer supports multiple serialization mechanisms. If more than one serialization mechanism is specified for the same type, which one gets used? Experimentation is the easiest way to figure out what happens. I'll look at different combinations

Serialization and Types

How does a DataContract type get initialized on the server? When I change the constructor for the type, nothing happens. Older serializers relied on calling the parameter-less constructor to initialize the type when deserializing data. Data contract types

Serializing UniqueId

Why can't UniqueId be serialized? Data contracts only have native support for a limited set of types. If you use a type that is not in this native set, then you'll get an exception that the data contract is invalid unless you decorate the type with attributes

Data Contract and Message Contract

I have an existing web service that I need to replace with a WCF web service. How do I choose between using a data contract and a message contract? There are actually three choices to consider for describing the messages that your service uses: data contracts,
 
Page view tracker