Solved

Need web service URL to be configurable

Posted on 2011-09-20
2
332 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
Introduction HyperText Transfer Protocol (http://www.ietf.org/rfc/rfc2616.txt) or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
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…

713 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