Re: Dynamically Change URL of web service
From: Chris Jackson (chrisjATmvpsDOTorgNOSPAM)
Date: 02/19/04
- Next message: Peter Steele: "Re: How to find control with focus?"
- Previous message: Jaime: "Windows Anchoring"
- In reply to: Derek Hart: "Re: Dynamically Change URL of web service"
- Next in thread: Derek Hart: "Re: Dynamically Change URL of web service"
- Reply: Derek Hart: "Re: Dynamically Change URL of web service"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 19 Feb 2004 15:50:32 -0500
Well, I just pulled this one off, and I can guarantee you it will work, as
it does here. Try putting in the full URL to the asmx file itself, and not
just the path. Also, make sure that you have it in quotes - you don't have
quotes in what you typed below, and I don't know if that was just quick
typing or not. (URL takes a string argument.)
myService.URL = "http://myserver/myWebService/Service1.asmx";
myService.invokeMethod();
I had completely forgotten that the URL property was public, which makes my
rather difficult (though functional) alternatives seem rather ... erm ...
silly. Sorry about that...
-- 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:OpJF02x9DHA.1052@TK2MSFTNGP12.phx.gbl... >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: Peter Steele: "Re: How to find control with focus?"
- Previous message: Jaime: "Windows Anchoring"
- In reply to: Derek Hart: "Re: Dynamically Change URL of web service"
- Next in thread: Derek Hart: "Re: Dynamically Change URL of web service"
- Reply: Derek Hart: "Re: Dynamically Change URL of web service"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|