Hi, Marek-

Unfortunately, RealProxy is juuuust beyond your grasp - the docs state that
applying the Proxy attribute to MarshalByRefObject is unsupported and
SoapHttpClientProtocol inherits from MarshalByRefObject. I believe it's
possible to accomplish it with a hack but it would anger the Gods of
Redmond.

Depending upon the desired behavior, you might find what you want in .NET's
SOAP extension mechanism. This allows you to plug a custom class into the
SOAP pipeline. Unfortunately, it doesn't allow you to short-circuit the
method call; you must pass the SOAP request/response to the remainder of the
processing pipeline. If all you are trying to do is modify the headers/body
of the SOAP envelope or to complete a task whenever a certain message flows
through the pipeline, it should be all you need.

-Andy Hopper
http://www.dotnetified.com

----- Original Message -----
From: "Marek Malowidzki" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, March 21, 2004 1:31 PM
Subject: [ADVANCED-DOTNET] Java's dynamic proxy in .NET?


> Hi all,
>
> I wonder whether there is a possibility to create a dynamic proxy for a
> class, in a similar manner to Java's dynamic proxy
> (java.lang.reflect.Proxy), to inject some code for every method called on
> some object? I would like all method calls to be delgated to some handler
> (InvocationHandler in Java).
>
> I need this functionality for a web service proxy, which delegates all
> methods to SoapHttpClientProtocol.Invoke(), but I would like to add some
> logic here. At present, I modify the automatically generated class, so
that
> all calls are delegated to a new virtual method, _Invoke(), which by
default
> calls SoapHttpClientProtocol.Invoke(), and may be overridden in a derived
> class. This is simple, but not too elegant (and, of course, needs work
when
> the proxy is updated).
>
> Best regards,
>
> Marek
>
> ===================================
> This list is hosted by DevelopMentor�  http://www.develop.com
> Some .NET courses you may be interested in:
>
> NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles
> http://www.develop.com/courses/gaspdotnetls
>
> View archives and manage your subscription(s) at
http://discuss.develop.com

===================================
This list is hosted by DevelopMentor�  http://www.develop.com
Some .NET courses you may be interested in:

NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles
http://www.develop.com/courses/gaspdotnetls

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to