Solved

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

Posted on 2014-11-05
6
224 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
  • 3
  • 3
6 Comments
 
LVL 32

Expert Comment

by:Stefan Hoffmann
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 32

Expert Comment

by:Stefan Hoffmann
ID: 40428154
Can you post some code? This explanation raises more questions..
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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 32

Expert Comment

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

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
New Relic recently released its Synthetics product that allows for the creation of performance monitors that periodically test a site's performance. If you wish to test an interactive workflow New Relic employs Selenium WebDriverJS to run those test…
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…

707 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

15 Experts available now in Live!

Get 1:1 Help Now