Solved

Need web service URL to be configurable

Posted on 2011-09-20
2
324 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
Comment Utility
You need to put the config entries in your Winform config. Then it will work.
0
 
LVL 1

Expert Comment

by:pothireddysunil
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Foreword In the years since this article was written, numerous hacking attacks have targeted password-protected web sites.  The storage of client passwords has become a subject of much discussion, some of it useful and some of it misguided.  Of cou…
Introduction A frequent question goes something like this, "How can I show an introductory page to my clients on the first site visit, but not show it again on every visit?"  The answer is by using a cookie.  This article shows the design pattern f…
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.
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…

763 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

7 Experts available now in Live!

Get 1:1 Help Now