Custom Remoting DataPortal with compression sequel

Thanks to Rocky's feedback I reworked my initial solution to make it a little better.
This one doesn't involve reflection at all and it implements a custom interface that is used only between the proxy and the server component.

Also, I see I created some confusion with an ill choice of namespace naming. I changed them to be more Csla like. The assembly name also changed. Sorry if you had trouble with that.

Also, I separated the "dynamic proxy" part from the actual proxy that does compression so if you don't really need it, you can skip it. The new proxy is called "CompressedRemotingProxy" and the server component "CompressedRemotingPortal".

Here's a sample for the relevant web.config section:


    <system.runtime.remoting>

        <application>

            <service>

                <wellknown mode="SingleCall" objectUri="RemotingPortal.rem" type="Csla.Server.Hosts.RemotingPortal, Csla"/>

                <wellknown mode="SingleCall" objectUri="RemotingPortalCompressed.rem" type="Csla.Server.CompressedRemotingPortal, Csla.Compression"/>

            </service>

            <channels>

                <channel ref="http">

                    <serverProviders>

                        <provider ref="wsdl"/>

                        <formatter ref="soap" typeFilterLevel="Full"/>

                        <formatter ref="binary" typeFilterLevel="Full"/>

                    </serverProviders>

                </channel>

            </channels>

        </application>

    </system.runtime.remoting>



And here's the same for the client's app.config:

        <add key="CslaDataPortalProxy" value="Csla.DataPortalClient.CompressedRemotingProxy, Csla.Compression"/>

        <add key="CslaAuthentication" value="Csla"/>

        <add key="CompressedDataPortalUrl" value="http://localhost/CompressedPortal/RemotingPortalCompressed.rem"/>

        <!--<add key="CslaDataPortalUrl" value="http://localhost/CompressedPortal/RemotingPortalCompressed.rem"/>-->



I created a new parameter for passing the url: CompressedDataPortalUrl. If the parameter is not found, it falls back to CslaDataPortalUrl (notice it's commented out in the snippet).

Make sure you test the server component from the browser in case you have something wrong in your config. Paste this as the url in your browser:
http://localhost/CompressedPortal/RemotingPortalCompressed.rem?wsdl

If you get an xml result then you're good to go.

For those of you who are interested in using the dynamic changing of dataportal types, use "CustomDataPortalRemotingProxy" instead of CompressedRemotingProxy in your app.config.


You can get the source code here.
Well, that's it. Enjoy!


Andrés

posted @ Monday, April 23, 2007 1:57 AM

Print

Comments on this entry:

# re: Custom Remoting DataPortal with compression sequel

Left by Stan at 5/2/2007 1:02 AM
Gravatar
I am a bit slow, I guess. I am missing something. When I check the remoting site I get an error stating it can't find Csla.DataPortal.Compressed.

What am I missing?

# re: Custom Remoting DataPortal with compression sequel

Left by Andrés at 5/3/2007 12:39 PM
Gravatar
Have you got the latest?? By the looks of it, you're using the old names, so I'd guess not.
Download the latest code and copy the config sections as sampled in this last article.
Notice that the namespaces changed to avoid the same problem you have right now.

# Random Rants

Left by Pictured Left at 5/9/2007 12:59 PM
Gravatar
[...] Here's a site I found today while I was bored at work: [...]

# re: Custom Remoting DataPortal with compression sequel

Left by Stan at 6/22/2007 4:42 PM
Gravatar
Just wanted to let you know, I did get around to really lookin at your solution and everything worked great. Thank you for your work on this topic.

# re: Custom Remoting DataPortal with compression sequel

Left by Naw at 6/28/2007 3:16 AM
Gravatar
Have you tried this with the compression built into .NET instead of the open source one? We'd like to avoid using another component.

# re: Custom Remoting DataPortal with compression sequel

Left by Andres at 7/4/2007 9:58 AM
Gravatar
I haven't personally tried that, but I heard someone did that with success. The framework only has support for gzip, which doesn't have the best compression ratio, but it does compress much faster than bzip2. If you were to do that, you only need to change the compression and decompression methods.

# re: Custom Remoting DataPortal with compression sequel

Left by David at 3/10/2008 8:52 PM
Gravatar
Thank you for your work on this project. Is there a reason you did not compress in incoming message in the create, delete, and fetch methods?
I am still trying to get my head around it. Your solution seems very clean and simple.
Thanks

# re: Custom Remoting DataPortal with compression sequel

Left by Tiago Freitas leal at 8/5/2009 12:31 PM
Gravatar
Hi Andrés,
I noticed a while ago that the Compressed DataPortal isn't working under Csla 3.5.

# re: Custom Remoting DataPortal with compression sequel

Left by Amir at 12/4/2009 12:36 AM
Gravatar
We are redeveloping certain modules of an application using CSLA. Since the application was developed using .NET 2.0 we need to use CSLA 2.1.4. Would we able to use Compressed Data Portal with remoting? If not, what would it take to do it.
Thanks.

Your comment:



 (will not be displayed)


 
 
 
Please add 6 and 4 and type the answer here:
 

Live Comment Preview:

 
«July»
SunMonTueWedThuFriSat
27282930123
45678910
11121314151617
18192021222324
25262728293031
1234567