[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Need web service URL to be configurable

Posted on 2011-09-20
2
Medium Priority
?
345 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 2000 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

NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

Question has a verified solution.

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

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…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

865 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