views:

41

answers:

1

Using WCF3.5SP1, VS2008. Building a WCF service that exposes about 10 service methods. We have defined about 40 [DataContract] types that are used by the service. We now experience that adding an additional [DataContract] type to the project (in the same namespace as the other existing types) does not get properly exposed. The new type is not in the XSD schemas generated with the WSDL. We have gone so far as to copy and rename an existing (and working) type, but it too is not present in the generated WSDL/XSD.

We've tried this on two different developer machines, same problem.

Is there a limit to the number of types that can exposed as [DataContract] for a Service? per Namespace?

+1  A: 

No, there's no hard limit on the number of Data Contracts - mostly certainly not as low as 40 or 50!

What I'm guessing might be the problem is this: you can add as many DataContracts as you like - but unless they're actually being used (as an input parameter or return type of a service method), they won't be serialized into the WSDL/XSD.

What happens if you add another dummy service method which takes one of your newly added types, and returns an arbitrary INT value or something. Does it show up in the WSDL/XSD then??

marc_s
Thanks marc_s. You were correct about the DataContract not being referenced by a service method. Adding a reference to it solved the problem.
Chris