Solved

Set the web service url dynamically for a class library from windows service application

Posted on 2014-11-05
6
238 Views
Last Modified: 2014-11-15
Hi All, I am having some issue with my web service and need some help.

I have a windows service application and it uses couple of class libraries. One of the class library has a web service and it was configured and I can't change it now. ( As I ma using dll's in my windows application)
Currently this web service is changed.

So, I want to change that class library web service url from my windows service application by using app.config file entry ( this app.config from windows service application).

Is it possible. How can I do that. If so how?

Thanks & Regards
0
Comment
Question by:pothireddysunil
[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
  • 3
  • 3
6 Comments
 
LVL 34

Expert Comment

by:ste5an
ID: 40425726
I solely depends on your library. How does it start the service? How does it bind the service?
0
 
LVL 1

Author Comment

by:pothireddysunil
ID: 40427124
The service is added through the web reference to the class Library and also to my windows service application.

So, it means I have two config files I.e., one for class library and one for my windows service.

I am using my test web service and set it as dynamic in my windows service.  Based on that it has an entry in the app.config file.

I am using class Library dll's in my windows service. When I am running my service, instead of calling test web service, it is calling production service and writing info in production.  Looks like my class library has production web service in it.

So, How can I resolve this issue and how can make my class library use the test web service which is in windows service app.config file.
0
 
LVL 34

Expert Comment

by:ste5an
ID: 40428154
Can you post some code? This explanation raises more questions..
0
Automating Your MSP Business

The road to profitability.
Delivering superior services is key to ensuring customer satisfaction and the consequent long-term relationships that enable MSPs to lock in predictable, recurring revenue. What's the best way to deliver superior service? One word: automation.

 
LVL 1

Accepted Solution

by:
pothireddysunil earned 0 total points
ID: 40433428
Hi All, thanks. I figured it out and here how I resolve the issue.

When ever we use a class library in a windows service or windows application, it always reads the main app.config file to get the config info.
So, I moved all my configuration information from the class library app.config file to the main app.config file ( which is from the windows service or windows application). That resolved my issue.

Thanks,
Sunil P
0
 
LVL 1

Author Closing Comment

by:pothireddysunil
ID: 40444299
Was able to resolve the issue by my self.
0
 
LVL 34

Expert Comment

by:ste5an
ID: 40444648
So your library depends on the default behaviour..
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

To properly understand GitHub, let’s divide it into two words ‘Git’ and ‘Hub’. Git is basically a ‘Distribution Version Control’ (DVC) and ‘Source Code Management’ (SCM) system widely used by software programmers while Hub means the efficient centre…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
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…

690 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