• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Need a solution with AppDomain in a WCF service

S

shiva

#1
Hi,

I have a library with all the classes are static and no control on the code
to me. I'm implementing an WCF service referencing this library. I'm looking
to support multiple client applications to make use of my WCF service which
runs in a different mahcine. I want to use WCF callback operations to
intimate the progress to each of the client application without client
polling the service.

I have multiple classes in my WCF service application that make calls to the
methods of the library. Around that I have a wrapper class from where the
process begins. I created and loaded each instance of this class in an
AppDomain by making a GUID for each client. I'm keeping the client callback
channels and my wrapper class instances for each client in collection
objects.

By using the above approach I'm able to process the operations for multiple
clients. But next I'm looking to intimate the progress of the requests to
each client application.

I tried to use delegates but the wrapper class is loaded in another
appdomain so I was not able register the event in my service host
implementing class. I tried to set the callback channels to AppDomain
property using AppDomain.SetData but I'm getting an error that

"Callback method InitializeLifetimeService is not supported, this can happen
if the method is not marked with OperationContractAttribute or if its
interface type is not the target of the ServiceContractAttribute's
CallbackContract."

I read CrossAppDomainDelegate but not getting how to use for my scenario. Is
there any other mechanism with which I can intimate the progress messages to
each client. If I can able to get a message to my service host implementation
class, I can use the callback channel list to send it to the respective
clients.

Please can anyone give any points in this regard. I appreciate your help.

Thanks...
--
Software Engineer
 

My Computer

S

shiva

#2
Please can anyone help me in this regard. I appreciate your great help.

--

"shiva" wrote:

> Hi,
>
> I have a library with all the classes are static and no control on the code
> to me. I'm implementing an WCF service referencing this library. I'm looking
> to support multiple client applications to make use of my WCF service which
> runs in a different mahcine. I want to use WCF callback operations to
> intimate the progress to each of the client application without client
> polling the service.
>
> I have multiple classes in my WCF service application that make calls to the
> methods of the library. Around that I have a wrapper class from where the
> process begins. I created and loaded each instance of this class in an
> AppDomain by making a GUID for each client. I'm keeping the client callback
> channels and my wrapper class instances for each client in collection
> objects.
>
> By using the above approach I'm able to process the operations for multiple
> clients. But next I'm looking to intimate the progress of the requests to
> each client application.
>
> I tried to use delegates but the wrapper class is loaded in another
> appdomain so I was not able register the event in my service host
> implementing class. I tried to set the callback channels to AppDomain
> property using AppDomain.SetData but I'm getting an error that
>
> "Callback method InitializeLifetimeService is not supported, this can happen
> if the method is not marked with OperationContractAttribute or if its
> interface type is not the target of the ServiceContractAttribute's
> CallbackContract."
>
> I read CrossAppDomainDelegate but not getting how to use for my scenario. Is
> there any other mechanism with which I can intimate the progress messages to
> each client. If I can able to get a message to my service host implementation
> class, I can use the callback channel list to send it to the respective
> clients.
>
> Please can anyone give any points in this regard. I appreciate your help.
>
> Thanks...
> --
 

My Computer