المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : How to dynamically add webservices in an application?



C# Programming
09-03-2009, 12:24 PM
This is what I want to do:

- I have made a WSDL (interface) which can be implemented by different web-services. Lets call this provideData.wsdl
- I want to make a c# console application where I can dynamically add different services (different ********s) which implements the same WSDL. Something like this:

static void Main(string[] args)
{
AddDataProvider("http://serviceA/a.asmx");
AddDataProvider("https://serviceB/b.asmx");
//Do something with the data, using a shared interface..
}

Normally when I consume a web-service in a C# project I just press "Add Service Reference...",
but how can I do this dynamically with code? http://www.barakasoft.com/script/Forums/Images/smiley_sniff.gif