views:

26

answers:

1

I see a huge number of request and response types in a project to cater for all the endpoints exposed as WCF services. This seems like an awful lot of repetitive, simple code to maintain.

Can these types be auto-generated or avoided altogether using something like attributes?

+1  A: 

They can be autogenerated a few ways. The two I'm most familiar with:

Web Service Software Factory - Modeling Edition. You maintain a UML-like model and let the factory generate much of your code. Code is generated as partial classes so you can manually add/override methods and more complex schema.

I also sometimes define all of the data in XML Schema, then use WSCF.blue to generate the contracts from the schema. Again, it creates partial classes so that you can tweak the generated contracts.

Toby