473,570 Members | 2,926 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2319
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******** *****@TK2MSFTNG P11.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********@hot mail.com> wrote in message
news:eN******** ******@TK2MSFTN GP10.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******** *****@TK2MSFTNG P11.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
/vboriintroducti ontoapplication settingstorage. asp>

Regards,
R.Balaji

"BS" <lb*@nospam.com > wrote in message
news:%2******** *******@TK2MSFT NGP12.phx.gbl.. .
Can you point out how to read and modify the app.config file ?
Thank you
"R.Balaji" <rb********@hot mail.com> wrote in message
news:eN******** ******@TK2MSFTN GP10.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******** *****@TK2MSFTNG P11.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
3429
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 right half of the image rotates it 90 degrees to the left or right. I want to change the cursor to indicate this but only while in the rotate mode....
2
1716
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 type. When changing the InnerText, I loose all child nodes. When cloning the node and reassigning the child nodes of the original node to the cloned...
1
1553
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 things can't be changed without dropping the original object (e.g Tables) and
6
1936
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 result 's are the same. How can I stop this from happening? I tried copying the array but that didn't work.
10
1680
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 private long variable that keeps changing for no reason. I have a trace file running to tell me what is going on. Here is kind of what is happening ...
3
3315
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: _ctl0__ctl1_GroupName__ctl0_ControlName which is very bad, because I'm using javascript which relies on the
1
1808
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
3652
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 RecordSource like this? Am I asking for trouble doing this with a memo field? Thanks in advance. Private Sub cmdNextNote_Click() Dim lngNid As Long...
18
2181
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 experiences of changing light bulbs and how the light bulb could have been changed differently
1
1898
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 boxes on a form. In the row source I use the primary key of the form as a criteria. For example, I have company details on the form. The list box...
0
7637
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7950
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8151
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8000
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6332
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5523
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3671
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1238
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
974
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.