Solved

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

Posted on 2014-11-05
6
227 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 33

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 33

Expert Comment

by:ste5an
ID: 40428154
Can you post some code? This explanation raises more questions..
0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
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 33

Expert Comment

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

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Keyboard 2 33
Hey!! 5 33
Cant save 3D 4 19
C# Gridview 1 29
These instructions are based on installing Owncloud on your new raspberry pi connected with a usb HDD. What do you need Part A? A Raspberry Pi, model B. A boot SD card for the Raspberry Pi. A usb HDD An Ethernet cable to connect to the lo…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
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…

776 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