Solved

dynamically reference a web service

Posted on 2010-11-15
4
741 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 69

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

While working on Silverlight and WCF application, I faced one issue where fault exception occurred at WCF operation contract is not getting propagated to Silverlight client. So after searching net I came to know that it was behavior by default for s…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

762 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now