Web Service Dynamic Proxy

As a part of a web service adapter for Service Invocation Framework I developed a code for dynamic web service proxy generation. Today I have decided to extract this code from Service Invocation Framework  and transform it into a small library for call a web service without generate static proxy code.

Download the library code and a sample of use from here.

Enjoy it!

Technorati tags: , , ,

Print | posted on Tuesday, January 09, 2007 12:03 PM

Feedback

# re: Web Service Dynamic Proxy

left by Jayesh at 4/12/2007 5:26 AM Gravatar
thanks

# re: Web Service Dynamic Proxy

left by Jayesh at 4/12/2007 5:38 AM Gravatar
Is there any other way to consume web service dynamically? means without interface object.

# re: Web Service Dynamic Proxy

left by Rodolfo Finochietti at 4/14/2007 9:01 AM Gravatar
Hi Jayesh,

Yes it is possible to generate proxies without interfaces. One of them is generate a proxy form WSDL and call methods by reflection. I can write an example if you need it.

# re: Web Service Dynamic Proxy

left by Luca at 6/4/2007 10:43 PM Gravatar
Great! but cannot generate proxy code for generics type. Can you help me for include this?

[XmlInclude(typeof(ResponseBaseOfMyObject))]

This class is included but not generated from proxy.

thx.

# re: Web Service Dynamic Proxy

left by Rodolfo Finochietti at 6/4/2007 11:04 PM Gravatar
Hi Luca,

I don't understand what you want to make. Could you explain to me more detailedly?

# re: Web Service Dynamic Proxy

left by archies at 8/22/2007 7:35 AM Gravatar
im new to writing web services , i need to write a dynamic proxy in a standalone java project using the existing wsdl .can u pls help me.

# re: Web Service Dynamic Proxy

left by Rodolfo Finochietti at 8/22/2007 12:02 PM Gravatar
Hi,

The client is .NET or Java?. I need more details to help you...

# re: Web Service Dynamic Proxy

left by Mohsen at 10/15/2007 12:46 AM Gravatar
Hello
Is it possible to define XmlInclude at runtime. I mean I want to loop through some classes by reflection and include their types in XmlInclude of a web method.
An easier question: how can I add an XmlInclude(typeof(XXX)) when XXX is in a class that this class is not in Bin folder of web service. I have tried probing and codebase but still web service give me compile error and it works if I copy that dll in Bin folder.
Thanks

# re: Web Service Dynamic Proxy

left by Rodolfo Finochietti at 10/15/2007 10:55 AM Gravatar
Hi Mohsen,

You can put the assembly where the XXX class is defined in the GAC or use event AppDomain.AssemblyResolve to load assembly from another location.

Check this http://msdn2.microsoft.com/en-us/library/system.appdomain.assemblyresolve.aspx

# re: Web Service Dynamic Proxy

left by Mohsen at 12/10/2007 8:42 AM Gravatar
Hi Rodolfo
How can I use event AppDomain.AssemblyResolve when my web service can not compile due to XXX.dll can not find.
Thanks

# re: Web Service Dynamic Proxy

left by John at 1/10/2008 5:51 AM Gravatar
Hi Rodolfo,

I would be happy if you could write a C# client to generate WCF Servcie Proxy dynamically by getting the WSDL url.

Thanks, John

# re: Web Service Dynamic Proxy

left by Rodolfo Finochietti at 1/12/2008 12:04 PM Gravatar
Hi John,

I write an example of how generate a dynamic proxy in WCF. You can download it from http://prototypes.shockbyte.com.ar/misc/WCFProxyGenerator.zip

# re: Web Service Dynamic Proxy

left by Igor at 3/20/2008 3:29 PM Gravatar
I have a project there I have to call some generic DLL from C++ that gets URL of the Web Service , Method and parameters for the any webservice . It looks like I can use your code. But I'd willing to purchase DLL that has a support . Do you know any comersial DLL that I can use?

# re: Web Service Dynamic Proxy

left by Rodolfo Finochietti at 5/12/2008 10:28 AM Gravatar
Sorry Igor,

I do not know any component commercial that does that work.

# Generics Issue with Dynamic Proxy

left by Tarun at 7/1/2008 9:16 AM Gravatar
This is great and thanks for sharing this!

However, we are facing a problem when a webmethod uses generics as input parameter - We always get a compilation error at runtime that the service does not implement the method.

For example,
public void GeneratePayment(List<Payment>) would fail while DynamicProxy tries to create a web service proxy by stating the service does not implement the method.

It works if I was to change this List to a DataSet or any other collection mechanism. Can you please throw some light on what could be going wrong here?


Regards,
Tarun

# re: Web Service Dynamic Proxy

left by Tarun at 7/4/2008 1:52 AM Gravatar
Hi there,
Thanks for sharing this, it is really helpful!

We are facing one problem though. Whenever a WebService takes Generic i.e. List<> as an input parameter, it fails to compile it stating the web service does not implement that method.

Can you please throw some light on whether this method work with .NET Generics or not. I would really appreciate if you could help us out in any way.

# re: Web Service Dynamic Proxy

left by dolphin at 8/6/2008 10:38 PM Gravatar
good,thanks for sharing.

# re: Web Service Dynamic Proxy

left by jaime Nascimento at 8/18/2008 2:31 PM Gravatar
Can we get the WSDL from a UDDI Server and generate the proxy dynamically?

Thanks,

Jaime

# Generic List Web Service Dynamic Proxy

left by rodolfof@blog at 8/24/2008 11:44 PM Gravatar
Generic List Web Service Dynamic Proxy

# Generic List support for Web Service Dynamic Proxy

left by rodolfof@blog at 8/25/2008 12:11 AM Gravatar
Generic List support for Web Service Dynamic Proxy

# Generic List support in Web Service Dynamic Proxy

left by rodolfof@blog at 8/25/2008 12:14 AM Gravatar
Generic List support in Web Service Dynamic Proxy

# Papa fritas, cervezas y una babel de esos raros lenguajes nuevos

left by Angel &quot;Java&quot; Lopez at 9/17/2008 8:54 AM Gravatar
Gracias a la gente de Microsoft de Argentina, en especial al bueno de Miguel Saez , tendré el gran gusto

# Dynamic Proxy

left by Ankur at 9/23/2008 5:00 AM Gravatar
Is there any proxy software which can share internet but without use ip & port on client computer it just work internet on client computer like share via router on by dynamic mode

# re: Web Service Dynamic Proxy

left by Rodolfo Finochietti at 9/23/2008 12:21 PM Gravatar
Sorry, I don't know any software with these features.

# re: Web Service Dynamic Proxy

left by Rodolfo Finochietti at 9/23/2008 12:23 PM Gravatar
Sorry, I don't know any proxy software with these features.

# re: Web Service Dynamic Proxy

left by Ratnakar Sinha at 10/14/2008 8:22 AM Gravatar
Amazing Stuff!!
Thanks a ton for sharing this splendid effort!

Ratnakar.
Title  
Name
Email (never displayed)
Url
Comments   
Please add 6 and 6 and type the answer here: