Solved

dynamically reference a web service

Posted on 2010-11-15
4
748 Views
Last Modified: 2012-06-21
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
Comment
Question by:mmingfeilam
  • 2
4 Comments
 
LVL 3

Expert Comment

by:JamesAperta
ID: 34141906
yes you can do that.  check out the following....

http://www.codeproject.com/KB/webservices/Dynamic_Invoke_webservice.aspx
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 34144001
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
 

Author Comment

by:mmingfeilam
ID: 34151436
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
 
LVL 3

Accepted Solution

by:
JamesAperta earned 500 total points
ID: 34151540
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Video Player 12 28
How to call weather service by using asmx? 4 44
Where did System.Data.Objects go? 2 40
jQuery - following an example but can I save data server side? 20 59
This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question