datacontracts

Business enum to DatContract Enum conversion in WCF

I have an enum namespace Business { public enum Color { Red,Green,Blue } } namespace DataContract { [DataContract] public enum Color { [EnumMember] Red, [EnumMember] Green, [EnumMember] Blue } } I have the same enum as a datacontract in WCF with same values. ...

Which types cannot be used for WCF?

I know for a matter of fact that Type cannot be used when passing in to a WCF service. Does anyone have a complete list? ...

DataContractSerializer KnownType attribute not being respected?

I have a class that is decorated with a KnownType attribute with a type of the class. Is this not allowed? [KnownType(typeof(Occ600UIConfig))] public class Occ600UIConfig { } If so, why is the DCS throwing the following exception? {"Error in line 1 position 387. Element 'http://schemas.microsoft.com/2003/10/Serial...

Share Json data between Asp.Net MVC 2 and Asp.Net server side C# code?

I created and love my Asp.Net MVC2 application. It's a very nice DDD app with Domain Model classes, View Model classes, a repository, and Json action methods to expose data. My coworker wants to share my data with his Asp.Net Forms based C# code. He wants to pull through the Internet a class definition (like a Data Contract), then fil...

WCF Rest Mutliple DataContracts Wrapped

So I am calling a wcf webservice using Rest WebHttp. I also have set up a second binding mex for testing. My method is working but when I try to test through fiddler or straight httppost through a client app I get a 400 Bad request error. I am passing mutliple datacontracts to the method. It forces me to use the BodyStyle of wrapped ...

Is there any way to hide/flatten base types in WCF service data contracts?

Consider the following simple example: [DataContract("{0}Base")] public class Base<T> where T : Entity<T> { // Common methods & properties. No WCF exposed properties } [DataContract] public class Employee : Base<Employee> { // WCF exposed properties } The base class Base has no properties of interest to the WCF service consu...

RIA DomainService not generating client code using DataContracts

Hello there, I'm working on a Silverlight 4.0 application and am using RIA services. I have created a class on the server-side which has DataContract and DataMember attributes applied to it. A DomainService exposes this class as a query result and as such, generates code for it on the client. But somehow it doesn't generate code for a...