Re: Dynamically Change URL of web service
From: Derek Hart (dmhart_at_gte.net)
Date: 02/19/04
- Next message: Adagios: "RE: menu clicks (c#)"
- Previous message: Rob Windsor [MVP]: "Re: c# Application development"
- In reply to: Chris Jackson: "Re: Dynamically Change URL of web service"
- Next in thread: Chris Jackson: "Re: Dynamically Change URL of web service"
- Reply: Chris Jackson: "Re: Dynamically Change URL of web service"
- Messages sorted by: [ date ] [ thread ]
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
> >
> >
> >
> >
> >
> >
> >
> >
>
>
- Next message: Adagios: "RE: menu clicks (c#)"
- Previous message: Rob Windsor [MVP]: "Re: c# Application development"
- In reply to: Chris Jackson: "Re: Dynamically Change URL of web service"
- Next in thread: Chris Jackson: "Re: Dynamically Change URL of web service"
- Reply: Chris Jackson: "Re: Dynamically Change URL of web service"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|