473,387 Members | 1,423 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,387 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 4679
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# program programatically during program...
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) { animal=(dog)animal;
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 input locales are installed on my computer;...
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 but one will be a backup which just waits doing...
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 creating a new customer in my asp.net 2 application, it...
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 altered at runtime as -
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 = 255.255.255.0, default gateway=10.1.2.1 I have...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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.