473,795 Members | 2,999 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 2330
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
3451
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. After looking at it in the Mozilla DOM inspector it seems as if the style is changing but neither...
2
1725
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 node, the children are not visilble in the InnerXml. To make it simple. How do I change the value...
1
1579
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
1947
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
1705
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 l_myVariable send l_myVariable out to tracefile Call a method send l_myVariable out to tracefile
3
3339
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
1821
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
3700
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 If Me.Dirty Then DoCmd.RunCommand acCmdSaveRecord
18
2212
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
1915
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 shows
0
9673
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10448
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10217
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10167
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10003
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5566
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4114
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2922
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.