Geeks With Blogs

WinToolZone - Spelunking Microsoft Technologies
I work as a developer on the Common Language Runtime (CLR) team, specifically in the areas of exception handling and CLR hosting.

The information in this weblog is provided "AS IS" with no warranties, and confers no rights. This weblog does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion. Inappropriate comments will be deleted at the authors discretion. All code samples are provided "AS IS" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

Inside and Out... An attempt to understand technology better...

Over the past weekend, I was working on implementing a Remoting Server that would serve CAO (Client Activated Object) to my Remoting client.

Went ahead, implemented the Remotable class and did a RegisterActivatedServiceType. Then, for the Remoting client to have the metadata, I used the SoapSuds extract the metadata and provide reference to the client. So far so good.

But then I executed my client, I got a deserialization error. Here's the Microsoft KB article that discusses this error:;en-us;823445

Ofcourse, you will need to get the service pack to get around this problem. But what do you do if that's not available? So, here's a workaround to this issue is this:

1) Write your Remotable class which is MarshalByRefObject

class MyRemotableClass : MarshalByRefObject, IRemotableClass
   // implementation comes here

IRemotableClass is the interface that your class implements and will be shared with the client to provide it with metadata.

2) Write a factory class that will be create a new instance of your Remotable class:

class MyRemotableClassFactory : MarshalByRefObject, IRemotableClassFactory
     // This is the factory method that will return a new instance of the RemotableClass;
    // Thus, we have a CAO behaviour.
   public IRemotableClass GetNewInstanceOfRemotableClass()
      return new MyRemotableClass();

IRemotableClassFactory interface serves the same purpose as IRemotableClass interface above.

3) Now, write your Remoting client that connects to the server (which got activated using RegisterWellKnownServiceType) using RegisterWellKnownClientType.

And you have a CAO implementation for yourself :) BTW, this issue is observed when the Remoting Server is running on .NET Framework 1.1 and not 1.0!

Posted on Friday, May 14, 2004 5:26 PM .NET Framework V1.X , Remoting | Back to top

Comments on this post: SoapSuds and Remoting - Issues using CAO under .NET Framework 1.1

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © Gaurav Khanna | Powered by: