tags:

views:

355

answers:

2

Hi,

  1. Right now we have around 5 service reference added to our projects in a single solution. I am force to add service reference even for projects having indirect dependencies calling service methods. Is there a way to get around for this situation.

  2. For every single change in the service method, I have to update every single service reference to effect those changes. It is very time consuming too. I am just wondering, is there any way i cam manage these things globally by making single service reference for the whole solution.

help appreciated.....:)

+1  A: 

You won't be able to get a single reference if you have multiple service, unfortunately.I stand corrected - see jrista's answer.

What you could do is create and update the service references automatically: instead of adding them manually in Visual Studio using Add Service Reference check out the svcutil.exe command line tool which will basically do the same thing.

Since it's a command line tool, you can have it run as e.g. part of your continuous build and update the necessary proxy client files every time you build the app.

Check out these additional links for tutorials and explanations about the details of using svcutil.exe:

Marc

marc_s
Using Svcutil, you can indeed generate a single service "reference" from multiple service endpoint URL's.
jrista
I wasn't aware that this was possible - thanks for pointing that out!
marc_s
+1  A: 

You should be able to use the svcutil.exe command line utility to generate a single service file (.cs file for example) from multiple service URL's. The nice thing about this is that you can share clinet-side DTO's and message types accross services if they have the same schema.

SvcUtil Reference: http://msdn.microsoft.com/en-us/library/aa347733.aspx

In regards to the requirement of adding the service reference to projects with indirect dependencies. You should probably not consume the service reference and related types directly from your service client. To improve maintainability and adaptability, you should wrap your service reference(s) in a facade. The facade would map between local types and service reference types, and give you much more agility in terms of responding to service changes. You would then only need to have the service references in a single location (preferably an independent project) along with the facade. The facade, which should change infrequently, will buffer you from the issues you are currently having with your service references.

jrista
Could someone please explain why this was voted down?
jrista