469,927 Members | 1,857 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,927 developers. It's quick & easy.

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 4508
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Schuntermann Joerg \(IFAT IT MFG COC MES MAC\) | last post: by
4 posts views Thread by AdamM | last post: by
3 posts views Thread by Ben Crinion | last post: by
3 posts views Thread by =?Utf-8?B?YmJkb2J1ZGR5?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.