views:

114

answers:

1

Hi,

I have a problem with WCF seemingly not including attributes such as Category when passing entities around.

I have a class wrapped around an EF entity, used to populate a property grid on a thick client.

I am trying to retrieve information from the server, using WCF, and to replicate the property grid on the client side. I have tested the code, and in the host, I am able to determine the category of the elements in the instance.

When I request an instance from an ASP.NET site, however, it seems that I cannot retrieve the category information. All I get is, Misc, so I assume that means when I serialize it, the attributes get stripped.

A: 

Information specific to .NET is not passed in metadata. Therefore, the information is not used in creating the proxy classes that you create using svcutil or "Add Service Reference". This is why attributes, or non-default constructors, or methods, or indexers, do not appear in proxy classes.

You should try to do without this sort of information. However, if you really need it, you can put those types into a separate assembly, and share it with the client. This will mean that you have to update all of your clients when you update that assembly.

John Saunders