Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / February 2005

Tip: Looking for answers? Try searching our database.

Exporting WS location (URL) to config file

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Michał Januszczyk - 22 Feb 2005 17:27 GMT
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
erymuzuan - 23 Feb 2005 00:24 GMT
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

> How to overcome this:
>
[quoted text clipped - 14 lines]
>     thanks for help
>     Michał Januszczyk

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.