Programatically changing web reference at runtime.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Nick via .NET 247

    #1

    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 programatically change 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 urlprogramatica lly during runtime.

    Is this the correct way to do this?

    (PS. Can't seem to find the UrlBehaviorProp erty in my projectproperti es for my static web reference. What am I missing?).

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

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

    <Id>8n9sDHwTF0i S4VZHrnO+7g==</Id>
  • Eric Cherng

    #2
    Re: Programatically changing web reference at runtime.

    When you have a Web service proxy class, it inherits from
    System.Web.Serv ices.Protocols. SoapHttpClientP rotocol. 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" <anonymous@dotn et247.com> wrote in message
    news:%23CrRl1QY EHA.3516@TK2MSF TNGP09.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 UrlBehaviorProp erty 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>8n9sDHwTF0i S4VZHrnO+7g==</Id>


    Comment

    Working...