1
votes

I am building a application that will expose some functionality using WCF web services.

I have a data class that is used throughout the app that I now want to use in the web services (I have simplified the below just for example). The trouble I am having is working out how to use the data class in the web service without including it in the interface as a DataContract. Im having a real blonde moment (no offence to blondes) and cannot figure it out.

So my solution:

Solution

My Web Service:

enter image description here

Web Service Interface with the Data Contract declared here all is fine:

enter image description here

But I want to use the ErrorRequest in DataClasses

enter image description here

1

1 Answers

2
votes

You have two options: Separate DataClasses to another Class Library and reference it in both projects (Common / WebServices) or create a copy of ErrorRequest in your webservices.

I would go with first option.