Re: How to Pass Object to Server?



Hi,

The solution may be easy enough, in the .NET Framework 1.1 the default
security for the remoting was changed (I don't know, or atleast I don't
remember, the reason why).

To fix the problem, you have to set the type filter level in both side
of your remoting.

provider.TypeFilterLevel = TypeFilterLevel.Full;

Here is an example how to declare it using the code.

// Creating a custom formatter for a TcpChannel sink chain.
BinaryServerFormatterSinkProvider provider = new
BinaryServerFormatterSinkProvider();
provider.TypeFilterLevel = TypeFilterLevel.Full; // ** here
is the interesting line
// Creating the IDictionary to set the port on the channel
instance.
IDictionary props = new Hashtable();
props["port"] = 2134;
// Pass the properties for the port setting and the server
provider in the server chain argument. (Client remains null here.)
TcpChannel chan = new TcpChannel(props, null, provider);

ChannelServices.RegisterChannel(chan);
RemotingConfiguration.RegisterWellKnownServiceType(
typeof(RemotingService),
"RemotingService.rem",
WellKnownObjectMode.Singleton);


If you are using the config file to configure your remoting, here is an
example for the client, the server side will be the same pattern.

<system.runtime.remoting>
<application name="Messenger.exe">
<channels>
<channel ref="tcp" port="0">
<serverProviders>
<provider ref="wsdl"/>
<formatter ref="soap" typeFilterLevel="Full"/>
<formatter ref="binary" typeFilterLevel="Full"/>
</serverProviders>
</channel>
</channels>
</application>
</system.runtime.remoting>


Here is an example of my server config file :
<system.runtime.remoting>
<customErrors mode="off" />
<application>
<service>
<wellknown mode="SingleCall" displayName="Database object"
type="MessengerManager.DBMessengerWrapper, MessengerManager"
objectUri="DBMessenger.rem" />
<wellknown mode="SingleCall" displayName="Converter object"
type="MessengerManager.ConverterWrapper, MessengerManager"
objectUri="Converter.rem" />
<wellknown mode="SingleCall" displayName="Server manager
object" type="MessengerManager.ServerControl, MessengerManager"
objectUri="ServerControl.rem" />
</service>
<channels>
<channel ref="tcp" port="65200">
<serverProviders>
<provider ref="wsdl"/>
<formatter ref="soap" typeFilterLevel="Full"/>
<formatter ref="binary" typeFilterLevel="Full"/>
</serverProviders>
</channel>
</channels>
</application>
</system.runtime.remoting>


I hope that will fix your problem!

Nicolas

.



Relevant Pages

  • RE: Need advise on concept ???
    ... Machine information are based on alarms (imagin your ca with a red ... remoting, messaging etc - I think your time might be better spent by ... each could be hosted in a server cluster (fronted by a load ... id on the appropriate IServerPlugIn assembly/class and then execute the ...
    (microsoft.public.dotnet.distributed_apps)
  • Re: Events in .Net Remoting
    ... I am writing with respect to the Events in .Net Remoting that I had ... another channel for the callbacks..both on client side. ... Then I force a method on the server end (through a GUI control on the ... >> the regular client side requests still work fine. ...
    (microsoft.public.dotnet.framework.remoting)
  • RE: Need advise on concept ???
    ... each could be hosted in a server cluster (fronted by a load ... provided methods for remoting. ... At the server, a message dispatcher service would receive the remoting call, ... id on the appropriate IServerPlugIn assembly/class and then execute the ...
    (microsoft.public.dotnet.distributed_apps)
  • Re: Delegate Failure after Migration to .NET 2.0 - Vista
    ... remoting to work in .NET 2.0 for you? ... ActivatedClientTypeEntry entry = new ... I make the single below call in order to register my server type. ... the client. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: simple communication btw 2 apps - use events?
    ... > The research on how to accomplish this brought me to .NET Remoting, ... Actually, client is the app, which makes a request, and server is this, ...
    (microsoft.public.dotnet.framework.remoting)

Loading