Solved

dynamically reference a web service

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Data Saving 5 56
c# string handling 1 27
Error on Add method 1 38
Adding  DYMO Labelprinter to c# client application 4 11
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

863 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

22 Experts available now in Live!

Get 1:1 Help Now