[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.webservices

Dynamically linking to WebServices

(SteveyWeavy)

1/24/2003 7:48:00 PM

I will have several webservices that do the same thing (they return
the Latitude & Longitude for a given list of addresses) and am
attempting to write a central controlling app that will pick and
choose among these services based on a configuration file I provide
and pinging of the various sites to see if they're available at
runtime.

My problem is I don't want to have to set up web References to all
these sites and more critically, I don't want to strongly type the
webservice name, e.g. "Dim oGeo As New localhost.Service1()" in my
code.

Can I do something along the lines of the following & How?

For i = 0 to M_AvailableWebServiceURLS.Length
dim oGeo & i.tostring() as new
M_AvailableWebServiceURLS(i).tostring
Next

I intend to then proceed to create IAsyncResult threads with a
callback to a function in my object that does the database update
(keeping the original object in scope is another topic I think I've
got covered with, embarassingly enough, a global counter I decrement).

Thank you,
Steve
1 Answer

Pierre Greborio

1/24/2003 9:41:00 PM

0

If the proxy is always the same and only the URL changes you can set it at
runtime, ie:

Dim oGeo As New localhost.Service1
oGeo.URL = "http//www.oGeo.com/Coord.asmx"

getting them for a data source. If you want build your SOAP call at runtime,
I suggest to see a very nice sample available here:
http://www.xmlwebservices.cc/index_S...

Pierre

--
--------------------------------------------------------------
UgiDotNet
http://www.ugi...
--------------------------------------------------------------
"SteveyWeavy" <FosterSB@yahoo.com> wrote in message
news:be1166d9.0301241020.6f86b064@posting.google.com...
> I will have several webservices that do the same thing (they return
> the Latitude & Longitude for a given list of addresses) and am
> attempting to write a central controlling app that will pick and
> choose among these services based on a configuration file I provide
> and pinging of the various sites to see if they're available at
> runtime.
>
> My problem is I don't want to have to set up web References to all
> these sites and more critically, I don't want to strongly type the
> webservice name, e.g. "Dim oGeo As New localhost.Service1()" in my
> code.
>
> Can I do something along the lines of the following & How?
>
> For i = 0 to M_AvailableWebServiceURLS.Length
> dim oGeo & i.tostring() as new
> M_AvailableWebServiceURLS(i).tostring
> Next
>
> I intend to then proceed to create IAsyncResult threads with a
> callback to a function in my object that does the database update
> (keeping the original object in scope is another topic I think I've
> got covered with, embarassingly enough, a global counter I decrement).
>
> Thank you,
> Steve