473,503 Members | 1,609 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dynamic Web Service calls

Hi,

Is there a way to connect to a Web Service dynamically at runtime (Web
Reference URL)? I have always used Visual Studio to create a Web Reference
and then used it in my code. However, that always requires the URL to the
Web Service to be the same on the staging site and the production site. Now
I have two instances of the same application running (Staging site and
Production) and want to store the URL in a file instead. Is there a way to
do this?

ex. Web.Config AppSetting <add key="WebServiceURL"
Value=http://....webserv.asmx>

Thank you
Maz.
Nov 23 '05 #1
4 4153
In the properties window of the Web Reference set the property

URL Behavior = Dynamic

This will put an entry into the app.config file that looks something like
this:

<add key="MyApp.TestService.TestService"
value="http://MyServer/MyVirtualDir/MyService.asmx"/>

Which can be edited to reflect the server you wish to work on either in the
app.config directly or in the Web Reference properties again by changing the
Web Reference URL property
"Maziar Aflatoun" wrote:
Hi,

Is there a way to connect to a Web Service dynamically at runtime (Web
Reference URL)? I have always used Visual Studio to create a Web Reference
and then used it in my code. However, that always requires the URL to the
Web Service to be the same on the staging site and the production site. Now
I have two instances of the same application running (Staging site and
Production) and want to store the URL in a file instead. Is there a way to
do this?

ex. Web.Config AppSetting <add key="WebServiceURL"
Value=http://....webserv.asmx>

Thank you
Maz.

Nov 23 '05 #2
In the properties window of the Web Reference set the property

URL Behavior = Dynamic

This will put an entry into the app.config file that looks something like
this:

<add key="MyApp.TestService.TestService"
value="http://MyServer/MyVirtualDir/MyService.asmx"/>

Which can be edited to reflect the server you wish to work on either in the
app.config directly or in the Web Reference properties again by changing the
Web Reference URL property
"Maziar Aflatoun" wrote:
Hi,

Is there a way to connect to a Web Service dynamically at runtime (Web
Reference URL)? I have always used Visual Studio to create a Web Reference
and then used it in my code. However, that always requires the URL to the
Web Service to be the same on the staging site and the production site. Now
I have two instances of the same application running (Staging site and
Production) and want to store the URL in a file instead. Is there a way to
do this?

ex. Web.Config AppSetting <add key="WebServiceURL"
Value=http://....webserv.asmx>

Thank you
Maz.

Nov 23 '05 #3
"=?Utf-8?B?U3RldmU=?=" <St***@discussions.microsoft.com> wrote in
news:19**********************************@microsof t.com:
Which can be edited to reflect the server you wish to work on either in
the app.config directly or in the Web Reference properties again by
changing the Web Reference URL property


You can also set this property using code directly.
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"

Blog: http://blogs.atozed.com/kudzu
Nov 23 '05 #4
"=?Utf-8?B?U3RldmU=?=" <St***@discussions.microsoft.com> wrote in
news:19**********************************@microsof t.com:
Which can be edited to reflect the server you wish to work on either in
the app.config directly or in the Web Reference properties again by
changing the Web Reference URL property


You can also set this property using code directly.
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"

Blog: http://blogs.atozed.com/kudzu
Nov 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
526
by: jabailo | last post by:
I wrote a program that loops through a file of records. It parses each line in the file and sends them to a web service that inserts them into an AS400DB2 database using Asynch calls. This is...
0
1047
by: Wajih-ur-Rehman | last post by:
Hello group, I have a window service that is a client to a Web Service. In the app.config file of my window service, i specify the url of the web service. When i compile it and run it, it goes...
8
2531
by: Eyeawanda Pondicherry | last post by:
I have put some code together that creates an enum dynamically from some database values. The enum can be read perfectly by an application that references the dynamically generated dll. If I...
7
1745
by: Ollie Riches | last post by:
I know this has probably been asked a lot but I can't find any good exmaples so.... Can anyone give some url's to C# code that dynaimcally generates a web service proxy at runtime? Cheers ...
5
3069
by: Demetri | last post by:
Is it possible to add a web service reference during runtime? If so, how? -- -Demetri
7
22471
by: Mike Livenspargar | last post by:
We have an application converted from v1.1 Framework to v2.0. The executable references a class library which in turn has a web reference. The web reference 'URL Behavior' is set to dynamic. We...
2
2523
by: James | last post by:
Hello, I have an existing MFC C++ project which I need to add the ability of sending WSDL calls out to a web service. When this project is deployed the web service URL will always change...
2
7034
by: assgar | last post by:
Hi Developemnt on win2003 server. Final server will be linux Apache,Mysql and PHP is being used. I use 2 scripts(form and process). The form displays multiple dynamic rows with chechboxs,...
0
7202
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,...
0
7332
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...
1
6991
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...
0
7462
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...
1
5014
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...
0
4673
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3167
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1512
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 ...
0
382
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...

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.