470,647 Members | 1,328 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,647 developers. It's quick & easy.

URL Changing

BS
Hello everybody
We're currently writing an application that consumes a WS.
I have added the Web reference for the services which was pointing to a demo
site.
Everything now works fine. I need to change my reference to point to the
live site where the same web service exists.

Is there a way for me to add some kind of variable in my code to use one or
the url without having 2 sets of references and by code test "if demo then
else" or 2 set of code where just the reference would be different ?

Thank you for your help ?
Nov 21 '05 #1
4 2239
Yep just put the Url of the webservice into the configuration file and then
at runtime read it into the Url property of the webservice.

hth
Richard
Nov 21 '05 #2
Hi,
In the web reference properties, change the URL Behaviour property from
Static to Dynamic.
Now this webservice URL will be stored in the app.config file.

You can change the reference in the app.config file to the live site at any
time.

You need not to change any code.

The application will take the URL from the config file.
Regards,
R.Balaji

"BS" <lb*@nospam.com> wrote in message
news:Oe*************@TK2MSFTNGP11.phx.gbl...
Hello everybody
We're currently writing an application that consumes a WS.
I have added the Web reference for the services which was pointing to a demo site.
Everything now works fine. I need to change my reference to point to the
live site where the same web service exists.

Is there a way for me to add some kind of variable in my code to use one or the url without having 2 sets of references and by code test "if demo then
else" or 2 set of code where just the reference would be different ?

Thank you for your help ?

Nov 21 '05 #3
BS
Can you point out how to read and modify the app.config file ?
Thank you
"R.Balaji" <rb********@hotmail.com> wrote in message
news:eN**************@TK2MSFTNGP10.phx.gbl...
Hi,
In the web reference properties, change the URL Behaviour property from
Static to Dynamic.
Now this webservice URL will be stored in the app.config file.

You can change the reference in the app.config file to the live site at any time.

You need not to change any code.

The application will take the URL from the config file.
Regards,
R.Balaji

"BS" <lb*@nospam.com> wrote in message
news:Oe*************@TK2MSFTNGP11.phx.gbl...
Hello everybody
We're currently writing an application that consumes a WS.
I have added the Web reference for the services which was pointing to a

demo
site.
Everything now works fine. I need to change my reference to point to the
live site where the same web service exists.

Is there a way for me to add some kind of variable in my code to use one

or
the url without having 2 sets of references and by code test "if demo then else" or 2 set of code where just the reference would be different ?

Thank you for your help ?


Nov 21 '05 #4
Hi,

You can change it manually.
There is no programming required.

See this link for more info.

<http://msdn.microsoft.com/library/de...-us/vbcon/html
/vboriintroductiontoapplicationsettingstorage.asp>

Regards,
R.Balaji

"BS" <lb*@nospam.com> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
Can you point out how to read and modify the app.config file ?
Thank you
"R.Balaji" <rb********@hotmail.com> wrote in message
news:eN**************@TK2MSFTNGP10.phx.gbl...
Hi,
In the web reference properties, change the URL Behaviour property from
Static to Dynamic.
Now this webservice URL will be stored in the app.config file.

You can change the reference in the app.config file to the live site at

any
time.

You need not to change any code.

The application will take the URL from the config file.
Regards,
R.Balaji

"BS" <lb*@nospam.com> wrote in message
news:Oe*************@TK2MSFTNGP11.phx.gbl...
Hello everybody
We're currently writing an application that consumes a WS.
I have added the Web reference for the services which was pointing to a
demo
site.
Everything now works fine. I need to change my reference to point to
the live site where the same web service exists.

Is there a way for me to add some kind of variable in my code to use
one or
the url without having 2 sets of references and by code test "if demo

then else" or 2 set of code where just the reference would be different ?

Thank you for your help ?



Nov 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Geoff Soper | last post: by
2 posts views Thread by Urs Vogel | last post: by
1 post views Thread by Paul Reddin | last post: by
6 posts views Thread by Eric | last post: by
10 posts views Thread by Altman | last post: by
3 posts views Thread by John | last post: by
1 post views Thread by Korara | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.