473,386 Members | 1,598 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

C# Proxy: how to switch between local and remote server

I'm using a visual studio generated proxy to use the web services, but
I can't seem to get it to switch from using a local version to the
actual web based web service. It always always always uses the local
version. I thought about creating a web reference to the version I
deployed to the server, but that means that I would have to change
every reference if I wanted to debug the code locally. I just want to
use the proxy and then have the proxy switch between the local test
web service and the remote, live web service.

Any one know how to do this? I've been stuck on it for days.

The only three places I can find to change these settings are at:1)
the web config folder. But I don't know how to add settings to it, if
its possible for what I want to do. 2) the web service project's
properties page. It allows me to choose to use IIS web server or the
visual studio development server, but that doesn't do a damn thing.
and 3) the web services .asmx.cs file has [WebService(Namespace =
"http://<ipAddress>/MyWebService")] in it. But that doesn't help me.

Thanks
Dave

Jun 1 '07 #1
1 2924
Dave,

In your code that accesses the generated proxy, try setting the Url property
to the Url of the production web service. You can set the Url in the
web.config file as an appSettings item, and then pull it in when you need
it. This way the code does not need to change, only a config file on
deployment.

Hope this helps,
Steve

<Da*********@gmail.comwrote in message
news:11**********************@h2g2000hsg.googlegro ups.com...
I'm using a visual studio generated proxy to use the web services, but
I can't seem to get it to switch from using a local version to the
actual web based web service. It always always always uses the local
version. I thought about creating a web reference to the version I
deployed to the server, but that means that I would have to change
every reference if I wanted to debug the code locally. I just want to
use the proxy and then have the proxy switch between the local test
web service and the remote, live web service.

Any one know how to do this? I've been stuck on it for days.

The only three places I can find to change these settings are at:1)
the web config folder. But I don't know how to add settings to it, if
its possible for what I want to do. 2) the web service project's
properties page. It allows me to choose to use IIS web server or the
visual studio development server, but that doesn't do a damn thing.
and 3) the web services .asmx.cs file has [WebService(Namespace =
"http://<ipAddress>/MyWebService")] in it. But that doesn't help me.

Thanks
Dave

Jun 6 '07 #2

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

Similar topics

3
by: Julia | last post by:
Hi, I have a windows application which create a singleton remote object And a net application which call the remote object both on the same machine(windows 2000,iis 5.0) here is the code...
0
by: Jim_H | last post by:
I am trying to set the Credentials property of my web service proxy and I cannot seem to get anything to work. I am calling a remote asmx page from an aspx and they each reside on different web...
12
by: Griff | last post by:
I have a two tier system. I've created a COM+ package on the data tier (Win2003) and exported it as a COM+proxy (v 1.0 compliant) and installed this onto a Win2000 web application. I've...
1
by: Jeevan | last post by:
Hi , I am working on developing an ASP.NET server control that is based on AJAX and need to call a webservice on a remote domain. To avoid the security warning from IE , I created a proxy...
4
by: jstobbs | last post by:
Hi all I am trying to create a lighweight tcp proxy server. I got this code from ActivePython documentation. What I am trying to accomplish, is I need to connect to local instance of the...
2
by: TheMaxx | last post by:
I try getting response from web site through proxy in my domain: WebClient wc = new WebClient(); WebProxy wProxy = new WebProxy(); CredentialCache cc = new CredentialCache();...
7
by: chandru1782 | last post by:
Dear friends, I am trying to use CPAN for installing some perl modules. i am using a ubuntu system, which has internet connection through lan and authenticated proxy. when trying to install...
2
by: | last post by:
Hi all, I have an asp.net 2.0 website that accesses a locally hosted web service. This works fine on servers that are connected to our network. However, I am having a problem with a laptop...
2
by: krishnakrish | last post by:
Hi, My name is krishna. I am using asp.net 2.0 with C#. I amusing Windows XP professional as OS. When I post some data to an external web server I get the error as "The Remote server returned an...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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,...
0
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...

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.