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

J

José Joye

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é
 
L

Lord2702

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 !!!
 
J

José Joye

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 said:
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 said:
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é
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top