[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.remoting

Repost: CallContext.GetData - cannot be used in the constructor of the Server object (Remoting

José Joye

9/20/2004 5:41:00 AM

I'm playing around with the "CallContext" class to pass around extra
information between my client and Server applications (implemented with
Remoting).
My Server is a SAO-singlecall.

If I try to use the CallContext.GetData() method to retrieved information
from within a method in the Server part, all if fine.
If I try to do it from within the Constructor (which is called each time
prior a method is executed on the Server [singlecall]), the information is
not available ?????

I tried to look at the MSDN documentation about when such a information is
made available. However, I did not find anything...
Can anyone tell me the reason why the "CallContext" information is not
available when the Server Object Constructor is called?

Thanks a lot,
José



2 Answers

Lord2702

9/20/2004 6:13:00 PM

0

Mon. Sep. 20, 2004 11:10 AM PT

I suppose your described scenario is exactly the same as I have in my
application. The reason is, that you are not able to get the CallContext in
the MBRO's ctor, because, this CallContext is available, only after the MBRO
is completely constructed, in other words, when its ctor execute comletely
only then in MBRO's method it is available.

You can see the behavior of SingleCall, ctor is not very important, as the
object is state-less, as soon it finishes its call it dispose it off. Hence,
I think CallContext is only available in MBRO's method call. It is not
clearly mentioned anywhere in MSDN, but if you read again the description
about the CallContext, and its examples, you will notice this fact.

Good Luck !!!

"José Joye" <jose.joye@KILLTHESPAMSbluewin.ch> wrote in message
news:uCJAeRtnEHA.3868@TK2MSFTNGP11.phx.gbl...
> I'm playing around with the "CallContext" class to pass around extra
> information between my client and Server applications (implemented with
> Remoting).
> My Server is a SAO-singlecall.
>
> If I try to use the CallContext.GetData() method to retrieved information
> from within a method in the Server part, all if fine.
> If I try to do it from within the Constructor (which is called each time
> prior a method is executed on the Server [singlecall]), the information is
> not available ?????
>
> I tried to look at the MSDN documentation about when such a information is
> made available. However, I did not find anything...
> Can anyone tell me the reason why the "CallContext" information is not
> available when the Server Object Constructor is called?
>
> Thanks a lot,
> José
>
>
>


José Joye

9/20/2004 7:10:00 PM

0

Thanks for your reply...

I guess I have to live with it... and in each method call a special utility
method to get the content of the callContext.
This is not what I was expecting...

José

"Lord2702" <Lord2702@MSN.com> a écrit dans le message de
news:ujSAn1znEHA.2948@TK2MSFTNGP11.phx.gbl...
> Mon. Sep. 20, 2004 11:10 AM PT
>
> I suppose your described scenario is exactly the same as I have in my
> application. The reason is, that you are not able to get the CallContext
in
> the MBRO's ctor, because, this CallContext is available, only after the
MBRO
> is completely constructed, in other words, when its ctor execute comletely
> only then in MBRO's method it is available.
>
> You can see the behavior of SingleCall, ctor is not very important, as the
> object is state-less, as soon it finishes its call it dispose it off.
Hence,
> I think CallContext is only available in MBRO's method call. It is not
> clearly mentioned anywhere in MSDN, but if you read again the description
> about the CallContext, and its examples, you will notice this fact.
>
> Good Luck !!!
>
> "José Joye" <jose.joye@KILLTHESPAMSbluewin.ch> wrote in message
> news:uCJAeRtnEHA.3868@TK2MSFTNGP11.phx.gbl...
> > I'm playing around with the "CallContext" class to pass around extra
> > information between my client and Server applications (implemented with
> > Remoting).
> > My Server is a SAO-singlecall.
> >
> > If I try to use the CallContext.GetData() method to retrieved
information
> > from within a method in the Server part, all if fine.
> > If I try to do it from within the Constructor (which is called each time
> > prior a method is executed on the Server [singlecall]), the information
is
> > not available ?????
> >
> > I tried to look at the MSDN documentation about when such a information
is
> > made available. However, I did not find anything...
> > Can anyone tell me the reason why the "CallContext" information is not
> > available when the Server Object Constructor is called?
> >
> > Thanks a lot,
> > José
> >
> >
> >
>
>