• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 760
  • Last Modified:

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?  
0
mmingfeilam
Asked:
mmingfeilam
  • 2
1 Solution
 
JamesApertaCommented:
yes you can do that.  check out the following....

http://www.codeproject.com/KB/webservices/Dynamic_Invoke_webservice.aspx
0
 
Éric MoreauSenior .Net ConsultantCommented:
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.
0
 
mmingfeilamAuthor Commented:
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.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now