CSLA WCF Callbacks and Notifications

CSLA WCF Callbacks and Notifications

Old forum URL: forums.lhotka.net/forums/t/11050.aspx

Hurty posted on Thursday, January 12, 2012

I've ran into some problems...

So far I have created about 20 BOs that must call Save() method in a transaction.

This must be implemented through the build-in CSLA's WCF support.

So I brought up WCF service, created CommandBase object and wrapped all the BOs in a transaction.

The DataPortal_Execute() works just fine, but I was wondering if there is any mechanism that I can notify the Client-Side application of the CommandBase object's save progress???

The scenario is as follows:

1. From the Client-Side I call CommandBase.Execute();

2. I wait untill all 20 BOs call and return from their Save(); method (executed on Server-Side)

3. Move on...


The goal is:

1. After each successful Save() method of BO (on Server-Side) the Server to report (through a Callback or any other Server-to-Client-Notification methid) to the Client its progress through the transaction within the CommandBase object.


Does anyone have any idea... ??? Any help would be very appreciated..


Thanks in advance... George.

JonnyBee replied on Saturday, January 14, 2012


CSLA does not provide support for callback from the server so you are on your own in implementing a wsDualHttpBinding.

Hurty replied on Saturday, January 14, 2012

Ok. But if I implement (say IWcfPortal interface) will I lose CSLA build-in functionality ???

Any Idea how this implementation would be made ?

I am totally lost.. :(

RockfordLhotka replied on Sunday, January 15, 2012

The data portal serializes the data to send it to/from the server.

The .NET data portal does this by allowing WCF to do the serialization.

The Silverlight data portal does its own serialization.

It might be the case that the .NET data portal (so a .NET client like WPF) could pass a reference to a callback object to the server through the ClientContext dictionary. So if you were using something like wsDualHttpBinding maybe you could do callbacks to that object.

I really don't know how that all works (the dual bindings), having not spent any time with them. But you could certainly try it and see if it works.

Hurty replied on Monday, January 16, 2012

Thank you all for your fast response...

Will try the proposed idea and will write back if it succeeded.

Stay tuned... :)


JonM replied on Monday, January 16, 2012

I just did a project where I needed callbacks.  It was not a CSLA.net project.  I ran across a great article that describes how to get dual binding done along with common issues.  I strongly suggest reading through it.  It saved me a lot of time and trouble.



Hurty replied on Tuesday, January 17, 2012

Thank you JonM... will read this article and will give it a try...

Cheers, George

Copyright (c) Marimer LLC