public Message UpdateCity(string code, City city)
MyResponseDataClass message = CreateMyResponse();
// use JSON.NET to serialize the response data
string myResponseBody = JsonConvert.Serialize(message);
return WebOperationContext.Current.CreateTextResponse (myResponseBody,
From that link, it looks like UpdateCity would have to take a Message parameter to be able to deserialize with JSON.NET. Is that correct? Any way around it?
How does that handle deserializing the incoming City object?
I know it's old, but solved my issue with TimeSpan and DateTime formats.
If you already use Message type to return the results an use WCF4 you can do something like following:
Oleg, many thanks, it works like a charm by returning Stream type, it stops Microsft serializer. I am aware of DataContractSerializerOperationBehavior, but it takes me to inheret my own Serializer from XmlObjectSerializer which is not an easy task. Your proposal is much simpler and straight forward, Thank you once more.
The usage of Extending Encoders and Serializers (see http://msdn.microsoft.com/en-us/library/ms733092.aspx) or other methods of Extending WCF like usage of DataContractSerializerOperationBehavior is very interesting, but for your special problem there are easier solution ways.