Michael Lam
asked on
dynamically reference a web service
let's say i have a console app written in c#, and part of the command line argument is the url of a web service (e.g. xxx.asmx) that i need to call. would it be possible to dynamically reference the web service (WS) upon retrieving the url? or do you must first do a service reference first?
you need to first add the web reference and at run time you replace the URL property of your reference. this exactly the same process as switching from development to production.
ASKER
i am sorry, the CTO had a change of heart, we are now using WCF services. the method in the codeproject website doesn't work for WCF services.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://www.codeproject.com/KB/webservices/Dynamic_Invoke_webservice.aspx