?
Solved

Need web service URL to be configurable

Posted on 2011-09-20
2
Medium Priority
?
342 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

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

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 One of the frequent application design questions goes something like this: "How can I confirm when a client registers on my web site?" The registration might be for general use of a self-administered site like a forum, or for attend…
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…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

649 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