How to access DIFFERENT web services at RUNTIME?

ProgMan

Well-known member
Joined
Nov 25, 2006
Messages
55
Location
UK
Programming Experience
3-5
Hello again :)

I was wondering how I can invoke different web services during runtime? For example, the client first contacts a web service (which is accessed through a design-time generated proxy) then the web method returns a URL for another webservice wsdl file as string. So, using this string (url), I want the client to access that other webservice (so this time, I can't use a design time generated proxy, it has to be generated during runtime)

How can I do it ?

N.B. I think, its called client invocation using dynamic proxy. However, I can't find any sample code in VB.net that does that.

Thanks a lot :)
 
I would say this is simply something you wouldn't do.

This article Introduction to .NET Web Services you know by heart now, so you know you call wsdl.exe to generate the proxy class, then you would use vbc.exe to generate a dll assembly, then load this assembly into memory, then use reflection to call methods of this new class. Problem is how to create code that will call a method you don't know at design time and don't have a purpose with. Usually you write code to use known classes, even with reflection you target specific classes or something you expect to find there.
 
Back
Top