473,385 Members | 1,472 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Exporting WS location (URL) to config file

How to overcome this:

I have a web service on my local machine (Machine A) and a client of it,
also running on machine A. I generate a client for this webservice using
wsdl.exe. Next, I add the generated file to solution, and can see generated
wrapper classes encapsulating operations on the web service.

And now, I want the very same code to run on another machine (Machine B),
however, the webservice used, will be localized in other place (Machine C).

Is it possible to export somehow location (URL) of the webservice into a
config file,
so as to avoid recompiling the wrappers of the webservice, when deploying on
the
target machine ?

thanks for help
Michał Januszczyk
Nov 23 '05 #1
1 2213
if you use VS.Net "add web reference" you can change the service url to
dynamic , this will create a new appsetting entry in your config file.
since you use wsdl.exe, you'll have to manually create this entry in the
config file,
<add key="MyWS.Url" value="http://...../...asmx"/>
now locate in your generated proxy, (in contructor) where it says
this.Url = "http://myoriginal/,....asmx";
change the line to
this.Url = ConfigurationSettings.AppSettings["MyWS.Url"];

regards
erymuzuan mustapa

Michał Januszczyk wrote:
How to overcome this:

I have a web service on my local machine (Machine A) and a client of it,
also running on machine A. I generate a client for this webservice using
wsdl.exe. Next, I add the generated file to solution, and can see generated
wrapper classes encapsulating operations on the web service.

And now, I want the very same code to run on another machine (Machine B),
however, the webservice used, will be localized in other place (Machine C).

Is it possible to export somehow location (URL) of the webservice into a
config file,
so as to avoid recompiling the wrappers of the webservice, when deploying on
the
target machine ?

thanks for help
Michał Januszczyk

Nov 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Rim | last post by:
Hi, How can I control the location of the bytecode files? The reason I ask is I want to place the bytecode in a directory different than source code for backup reasons. Our backup system is...
2
by: Vincenzo Davi | last post by:
I have created a dll with several classes in C#. One of the classes references image files in the subdirectories of the bin/Release folder (basically where the dll resides). Now, I want to use...
0
by: Joe Abou Jaoude | last post by:
I have an application that support multiple cultures. the main folder is english, and the subfolder "French" is french. I don't want to create a web config in the subfolder french to specify the...
10
by: mike | last post by:
Is it possible to move the web.config out of the application folder? I would like it off somewhere out of the web directory
3
by: serge calderara | last post by:
Dear all, How to configure in config file, the fact that all users get access to the root web folder but only some of them to a restricted forlder Any sample ? thnaks for your help regards...
6
by: Stewart Saathoff | last post by:
Hello, I would like to programatically redirect the location of a web service from the client machine. Let me explain further. This is the exact process: I would like the client to click a...
0
by: Luke Dalessandro | last post by:
I have an application with a web page that I would like to run as if it were at a different location than it actually resides at. As an example: Imagine that I have a site layout as, ~/...
3
by: David P. Donahue | last post by:
I'm re-writing an application in C# that was originally written in Delphi 7. The heart of the application is a DataSet displayed in a DataGrid. One of the main functions of the previous...
1
by: n33470 | last post by:
Hi all, We have an asp.net 1.1 app that we're in the process of converting to 2.0. What I'm about to describe runs just great in the 1.1 framework, but does not work in the 2.0 framework. ...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.