Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are these WCF service reference files

When I add a WCF service reference in Visual Studio 2008, a directory named Service Reference\ServiceReferenceNamespace is created.

In this directory, there's files named Service.xsd, Service1.xsd, Service2.xsd, Service3.xsd and Service4.xsd. The files are not duplicates - the different files defines different types and elements. When I first created the service refernece, there was just one file but more Service*-files have been added when I've added more DataContract and OperationContracts.

It looks a bit strange that 5 different files are generated and not just one. If I delete the service reference (and hence the directory) and then add it again, the same files are added again.

Can anyone explain why several files are created and not just one?

like image 910
Martin Avatar asked Nov 18 '09 10:11

Martin


1 Answers

When you do Add Service Reference, VS first downloads the metadata -- as WSDL and XSD files -- that describes the service. These get stored in the ServiceReference directory. Then VS runs a code generation step using those files as input, producing the Reference.cs or .vb as output.

like image 161
alexdej Avatar answered Oct 28 '22 17:10

alexdej