Solved

Need web service URL to be configurable

Posted on 2011-09-20
2
327 Views
Last Modified: 2014-11-05
Dear Experts,

We have a Visual Studio 2010 solution with multiple projects. The startup project is a winforms project and has a reference to a class library project in the same solution. The class library project has a web reference to a classic ASP.Net web service not in the solution. So the dependency chart is like:

Winform startup project -> Class Library Project -> ASP.Net web service

Due to some constraints, we have to keep the web reference on the class library project.

The code works perfectly fine. The startup project calls a class's method in the class library and the class method calls the web service.

The question is - how do I make the URL of the web service configurable? The app.config file on the class library has the URL to the web service. But the solution does not use that app.config at runtime.

I changed the reference.cs (under web reference on the class library) file's constructor to read the value from config file.

this.url = read from config file.

But I think Reference.cs will be overwritten the next time the web reference is updated.

I am sure there is a better solution to this problem? Please help.

All code is written in C# and we are using .Net 4.0.





0
Comment
Question by:shekhar_shashi
2 Comments
 
LVL 2

Accepted Solution

by:
cslimrun earned 500 total points
ID: 36583358
You need to put the config entries in your Winform config. Then it will work.
0
 
LVL 1

Expert Comment

by:pothireddysunil
ID: 40424678
Hi shekhar_shashi ,  how did you performed this task. I have similar situation. Can you let me know how did you performed this. Thanks, Sunil P
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

919 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

12 Experts available now in Live!

Get 1:1 Help Now