Multiple Data Contracts in One Data contract

Topics: Service Factory Modeling Edition Forum
Jun 17, 2009 at 10:07 AM

Hi Guys,

 

I may be something really simple but my situtation is as follows.

I have a WCF service that enables the download of XML reports. All the reports have the same arguments by the deliver slightly data.  I have created 9 different Data contracts on the same data contract model. However when I try Validate the Data contract it seems to need that all the data contracts are called the same.

I haven't found a good example of modelling a service with multiple data contracts, all the samples seem to be a pretty much hello world, with 1 service contract , 1 Data Contract scenario.

Developer
Jun 17, 2009 at 12:00 PM

Hi,

I'm not sure if I got it right when you say that all DC are called the same? If that the case then you might design your DCs in a way that the may tell its content/meaning by some prefix name ir the like. Ideally you may reuse your DCs in different Message Contracts and Operations in your Service Contract.

In case you may find it useful, you can read something about DCs and MCs approach, http://www.codeplex.com/servicefactory/Thread/View.aspx?ThreadId=21927

Jun 17, 2009 at 12:09 PM

@hernandelahitte :  Apologies,  I think I have it starting to work.   What I had was I had Multiple Data Contracts, that are going to be sent back.   I had designed my Data Contracts, but after reading some documentation I realised I was being a complete n00b, as I now realise that I need to create a Data Contract Collection for my items.  I am just finding the modelling of services a little bit cumbersome at the moment, mostly because I don't know how to use the tool completely. I have a good book, but like every other book it only supplies a very simple solution to a problem, and I am now trying to do something a little more complex.  I'm sure I'll get the hang of it.

Thank you for your response