I am currently working with WCF services. I am writing both the client (consuming application) and host (services application).
Working on the client, I am writing the code for it, I have 3 options.
- Add Service Reference to the endpoint in the client
- Generate service reference using svc util
- Write the Channel and Service reference etc and share a library between the host and client containing the request and response objects
I am currently leaning towards option 2, using svc util. I have done this in the past with a command similar to this:
svcutil /t:code http://localhost.myapp.com/MyService.svc /out:"..\Folder\MyServiceReference.cs" /n:*,MyNamespace.MyApp.MyService/UseSerializerForFaults /ct:System.Collections.Generic.List`1
From the above, it generates the service reference in to the one class. I would like to be able to modify this so that each class from the service reference generation is added to separate classes. For example, all request objects and generated in to the Request folder, response objects in to Response folder, Channel in to a Channels folder and all other entites in another folder.
Firstly, feedback on the my choice of the second alternative? And also, is it possible to use svcutil to generate classes as outlined above?