472,353 Members | 1,650 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Programatically changing web reference at runtime.

I have a similar problem trying to use web services with awindows form application. I currently use a static web referencein my project. What I am trying to do is to programaticallychange the url based on a server name passed in, and whether ornot the PDA is in the active sync cradle.

IE. If the PDA is in the cradle, use localhost. If the PDA isn'tin the cradle, then allow connection over wi-fi to any validwebservice by changing the computer name in the urlprogramatically during runtime.

Is this the correct way to do this?

(PS. Can't seem to find the UrlBehaviorProperty in my projectproperties for my static web reference. What am I missing?).

--------------------------------
From: Nick

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>8n9sDHwTF0iS4VZHrnO+7g==</Id>
Nov 21 '05 #1
1 4604
When you have a Web service proxy class, it inherits from
System.Web.Services.Protocols.SoapHttpClientProtoc ol. This class uses the
Url property to determine where the Web service is located. So you can
modify this property if the destination of your Web service changes.

Eric
"Nick via .NET 247" <an*******@dotnet247.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
I have a similar problem trying to use web services with a windows form
application. I currently use a static web reference in my project. What I am
trying to do is to programatically change the url based on a server name
passed in, and whether or not the PDA is in the active sync cradle.

IE. If the PDA is in the cradle, use localhost. If the PDA isn't in the
cradle, then allow connection over wi-fi to any valid webservice by changing
the computer name in the url programatically during runtime.

Is this the correct way to do this?

(PS. Can't seem to find the UrlBehaviorProperty in my project properties for
my static web reference. What am I missing?).

--------------------------------
From: Nick

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>8n9sDHwTF0iS4VZHrnO+7g==</Id>
Nov 21 '05 #2

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

Similar topics

9
by: Tom | last post by:
How do you programatically get a list of subfolders in a folder? Thanks! Tom
1
by: Schuntermann Joerg \(IFAT IT MFG COC MES MAC\) | last post by:
This sounds like a trivial task: I'd like to change the default color settings for certain system elements (e.g. Control, Meu, Window) inside a C#...
4
by: AdamM | last post by:
How can I change an object's type at runtime? For example, here's what I want to do in psedocode: object animal; if (dog) {...
2
by: ziad dodin | last post by:
in an application where a feild (for example Name or item description)is to be entered in both ENGLISH and the Local language say ARABIC: the two...
3
by: Ben Crinion | last post by:
I am creating a web service which will be available on only one of two servers at a time. Both servers will have exactly the same services running...
8
by: Rak | last post by:
I am looking for a way to programatically change the .net version of the virtual directory that I am creating within a aspx page. As part of...
3
by: =?Utf-8?B?YmJkb2J1ZGR5?= | last post by:
I need to add a web reference programatically on the application's load event. Can anybody help me out with this Thanks in advance
17
by: blufox | last post by:
Hi All, Can i change the execution path of methods in my process at runtime? e.g a()->b()->c()->d()->e() Now, i want execution to be...
1
by: rufusking | last post by:
My requirement is to change the IP Address of local system programatically using .net. IP Address should change to 10.1.2.100, subnet mask =...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
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...
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...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....
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...

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.