all groups > dotnet remoting > august 2004 >
You're in the

dotnet remoting

group:

Server to Client is Fine Client to Server is SerializationException


Server to Client is Fine Client to Server is SerializationException Lord2702
8/24/2004 10:10:06 PM
dotnet remoting:
Tue. Aug. 24, 2004 10:10 PM PT

I have a remoting server, SingleCall, on which I am hosting a COM+ Business
Object Component, Now when I am getting an Object/ Class, which is marked by
Serializable Attribute, also, using Custom serialization with ISerializable
interface, with protected: Constructor, and GetObjectData method. This
object is derived from MarshalByRefObject. Because, I only want to serialize
this on client and then server side.

Without applying any security permission I get this object passed correctly,
from server to client, and client receives it correctly.

Now, I want to pass it from client to Server, but I get
SerializationException, that security is not permitted. I apply the Security
attribute as follows:

[SecurityPermissionAttribute(SecurityAction::Demand,SerializationFormatter=t
rue)]

But still I am getting the same exception ? Why ? or anything more I have to
do, like instead using protected: constructor, do I have to use
SetObjectData, and mark this method with security attribute. Anyhow, I want
to send this object from Client to Server.

Any idea.

Thanks in advance.

Re: Server to Client is Fine Client to Server is SerializationException Ken Kolda
8/25/2004 8:08:13 AM
Have you set the typeFilterLevel = Full on both client and server's
formatter sinks? See:

http://blogs.msdn.com/sanpil/archive/2004/02/23/78754.aspx

Ken


[quoted text, click to view]

Re: Server to Client is Fine Client to Server is SerializationException Lord2702
8/25/2004 9:56:17 PM
Wed. Aug. 25, 2004, 9:55 PM PT

Ken,

Although, your solution works great for me, and Thank you very much, but,
the same is not working for Http channel, although, I want to use Binary
formatter for http. But when I set it the given solution, for Tcp it is
working fine, but for Http, it throws an exception while loading Business
Object on client side, whereas server works fine. Exception is:
ArgumentNullException.
Message: No message was deserialized prior to calling the
DispatchChannelSink.
Parameter name: requestMsg

Even I try to set typeFilterLevel to Low for Http channel, but since it is
default, it is not working.

I am not using, and don't want to use, config. file, but rather
programmatically configuring the server, and client configurations.

Thanks and apreciate your help.

[quoted text, click to view]

Re: Server to Client is Fine Client to Server is SerializationException Sam Santiago
8/25/2004 10:08:31 PM
Here's an example of configuring HTTP channels programmatically:

Client Side:

Dim clientProv As BinaryClientFormatterSinkProvider
Dim serverProv As BinaryServerFormatterSinkProvider = New
BinaryServerFormatterSinkProvider
serverProv.TypeFilterLevel =
System.Runtime.Serialization.Formatters.TypeFilterLevel.Full
clientProv = New BinaryClientFormatterSinkProvider
Dim props As IDictionary = New Hashtable
props("port") = 0
Dim chan As HttpChannel = New HttpChannel(props, clientProv, serverProv)
ChannelServices.RegisterChannel(chan)

Server Side:

Dim clientProv As BinaryClientFormatterSinkProvider
Dim serverProv As BinaryServerFormatterSinkProvider = New
BinaryServerFormatterSinkProviderserverProv.TypeFilterLevel =
System.Runtime.Serialization.Formatters.TypeFilterLevel.Full
clientProv = New BinaryClientFormatterSinkProvider
Dim props As IDictionary = New Hashtable
props("port") = 8085
Dim chan As HttpChannel = New HttpChannel(props, clientProv, serverProv)
ChannelServices.RegisterChannel(chan)


Thanks,

Sam

--
_______________________________
Sam Santiago
ssantiago@n0spam-SoftiTechture.com
http://www.SoftiTechture.com
_______________________________
[quoted text, click to view]

Re: Server to Client is Fine Client to Server is SerializationException Lord2702
8/25/2004 10:51:48 PM
Wed. Aug. 25, 2004 10:50 PM PT

Millions, Trillions, Zillions Thanks to Both, ken, and Sam. It works. One
more thank, to Sam, for answering my problem SO quickly, and I was just
waiting for the answer, I tried and it works. Thanks.

[quoted text, click to view]

AddThis Social Bookmark Button