472,365 Members | 1,272 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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 2277
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Geoff Soper | last post by:
I'm trying to dynamically change the cursor of a couple of maps over an image. Basically the image is in an online photo system where there is a rotate mode. In this mode clicking on the left or...
2
by: Urs Vogel | last post by:
Hi When using XmlDocument, I can create nodes and attributes as I like. What I didn't achieve is changing the Value of a node (created with createElement), it claims that it's the wrong node...
1
by: Paul Reddin | last post by:
Hi, Can anyone tell me if the changing of DB Objects in Stinger has been improved ? e.g Changing optionality, renaming etc..... I spend an awful lot of time changing objects because many...
6
by: Eric | last post by:
I have an array, result. I populate the array and add it to an ArrayList. I then change result and add the new version to the ArrayList. However, when I go to review the ArrayList, all of the...
10
by: Altman | last post by:
I have only done a little programming in C++ so I am still learning but I am having a problem with a variable that is changing on me. I have tried this 2 ways with the same result. I have a...
3
by: John | last post by:
I have an asp.net control which on the first Load of the page has a unique ID something like: _ctl0__ctl1_GroupName__ctl1_ControlName and after the first postback it changes to: ...
1
by: Pablo | last post by:
I do not know like changing the color of bottom of: a menu, of the bar of the title of form, messagebox?
32
by: deko | last post by:
I have a popup form with a textbox that is bound to a memo field. I've been warned about memo fields so I'm wondering if I should use this code. Is there any risk with changing the form's...
18
by: Chris Hills | last post by:
A lesson in Posting How many C.L.C group posters does it take to change a C light bulb? 1 to change the light bulb and to post that the light bulb has been changed 14 to share similar...
1
by: DrJarmin | last post by:
Hello The problem is this: in the criteria for a list box I reference the parent form - and Access KEEPS changing the criteria for one that won't work. Details below: I have a couple of list...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...

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.