Using NuGet to add references to web services

Jan 10, 2012 at 5:27 PM

Hi all,
I'd like to use NuGet to add references to web services, a là "add service reference".
I made an attempt creating a package from a web service project and installing it in a client application, but it simply copies the .svc file to the client application and adds the reference to the web service dll... definitely not what I want... :-)
I've googled around but found nothing.
Basically I'd like to use NuGet in a SOA scenario, can you please give me some hints?

Thanks in advance,

Jan 23, 2012 at 10:13 PM

Doesn't VS add stubs when you add a web service reference?

Jan 23, 2012 at 10:59 PM

Well, after thinking up, actually I figured it out myself: services references after all are just proxy classes (stubs) plus the plumbing to call the web service, and some configuration settings. You can create a separate assembly and generate the classes you need via svcutil, so the project that consumes services can add reference to this assembly as if it was local reference.