Re: Dynamically Change URL of web service

From: Derek Hart (dmhart_at_gte.net)
Date: 02/19/04


Date: Thu, 19 Feb 2004 11:22:12 -0800

I need to be able to read the URL from a database. Different windows forms
client apps will use the exact same web service, but on different servers.
So when my app loads, I need to read the URL before I make the first method
call on the web service. When I use the following code:

Dim myService As New myService.webService

myService.Url = http://myserver.mywebservice.net/

myservice.MethodCall1

I get the error "the request failed with http status 405" when I make my
first method call.

I have seen a ton of responses such as yours, but I have not a lot of people
successfully pull this one off. And I have set the URL Behavior to dynamic.
It seems like more things need to be set here. If I have to look into the
app.config file, that is fine, but I really want to set this dynamically
from a database.

Derek

"Chris Jackson" <chrisjATmvpsDOTorgNOSPAM> wrote in message
news:eUOv1tx9DHA.1948@TK2MSFTNGP12.phx.gbl...
> If you select this web reference, you can change the properties to make
this
> dynamic. What this does is put an entry in the config file, so you can
> update it by simply changing the config file. (Very handy for moving
through
> dev, staging, and production.) If you need to be able to dynamically set
it,
> you can either rewrite this code and grab it from a variable (in which
case
> it will be overwritten if you ever refresh this reference) or you can open
> up the config file as an XML file and edit the XML.
>
> --
> Chris Jackson
> Software Engineer
> Microsoft MVP - Windows Client
> Windows XP Associate Expert
> --
> More people read the newsgroups than read my email.
> Reply to the newsgroup for a faster response.
> (Control-G using Outlook Express)
> --
>
> "Derek Hart" <dmhart@gte.net> wrote in message
> news:e3R3Kaw9DHA.440@TK2MSFTNGP10.phx.gbl...
> >I have a the same web service that sits on multiple servers. All I want
to
> > do is change the URL that the client app points to. I found this code
in
> > the Reference.vb file under the web reference:
> >
> >
> >
> > Public Sub New()
> >
> > MyBase.New
> >
> > Me.Url = "http://abccompany.tam.net/tam/tam.asmx"
> >
> > End Sub
> >
> >
> >
> > How can I dynamically change this when the client app loads. What
VB.NET
> > code would I use?
> >
> >
> >
> > Derek
> >
> >
> >
> >
> >
> >
> >
> >
>
>



Relevant Pages

  • Re: Dynamically Change URL of web service
    ... Microsoft MVP - Windows Client ... > client apps will use the exact same web service, ... What this does is put an entry in the config file, ... >>> How can I dynamically change this when the client app loads. ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: Getting user ID from Web Service credentials
    ... and I'm trying to implement Windows authentication. ... > OK in the standalone client app (I use their Windows current user name to ... When I use a Web Service, ... > name in the credentials object above from the client side, ...
    (microsoft.public.dotnet.security)
  • Re: ADFS Development Issues
    ... One thing to keep in mind is that if a website is protected by ADFS V1, ... site to be automatically authenticated by our windows application so ... like a web service proxy. ... generated on the server. ...
    (microsoft.public.windows.server.active_directory)
  • Re: ADFS Development Issues
    ... site to be automatically authenticated by our windows application so ... based on redirects and possibly uses forms-based authentication to collect ... web service proxies don't handle this type of thing ... the server based on how it needs to work. ...
    (microsoft.public.windows.server.active_directory)
  • RE: Web Service Security
    ... You could encrypt or hash your ... As far as web service authentication/authorisation is concerned you would be ... WSE does a pretty good job of abstracting away most of the ... a windows domain account). ...
    (microsoft.public.dotnet.framework.webservices)

Loading