I have a .net web service reference and I want to pass it to a function in a different library (ie, a lib without the service reference). Unfortunately I want to pass two different kinds of services to this function.
I know all about interfaces and how this should be done, but I need to know how this is done within the microsoft service reference framework. I like how you can right click and add a service, but now I need to pass the generated class into a function and I want to know how other people manage this.
Your question is unclear. It almost sounds like you don’t understand how computer programs work.
I’m going to assume that you actually do, but simply haven’t expressed your question well. I will make a guess that your issue is that you don’t know how to use two different implementations of the same service and switch between them.
There are several overloads of the constructor for a service reference proxy class. One of these accepts an endpoint. Simply pass the URL of the service you want to that constructor, and you’re all set. At worse, this means that you need to pass the URL to your library so that your library can create the correct instance.