R – .NET web service without proxy class

netproxy-classesreflectionweb services

I'm trying to create an application that will let me execute a method specified at runtime on an arbitrary webservice (the URL of which I'll also provide at runtime). I've figured out how to use Type.InvokeMember to execute the arbitrary method, but how do I specify the web service to consume without creating a proxy class.

I found How do I call a webservice without a web reference? which will helps me out if I already have the WSDL and only the URL will change, but I'd like to be able to call any webservice and fetch the result.

Thanks.

Best Answer

You should take a look at Dynamic Proxy for WCF (I'm sorry, but I can seem to find a link to it right now) - it's a library that lets you inspect services at runtime (if they publish their metadata), and also invoke methods (no need for metadata to do that).

Edit: actually, it seems that there is a project on Codeplex to do just that: SIF