PDA

View Full Version : Remoting + IIS + http + BinaryFormatter


DroleDeCerfeuil
06-28-2007, 12:57 PM
Hi all !

I would like to use a remote service exposed via Spring.Net Remoting. The server is host by IIS and the communication protocol is http with a binary serialization.

The remote service is define in the server's Spring.Config file :
<object name="remoteElementService" type="Spring.Remoting.SaoExporter, Spring.Services">
<property name="TargetName" value="businessElementService" />
<property name="ServiceName" value="RemotedBusinessElementService.rem" />
<property name="Infinite" value="false" />
</object>

In the Web.Config file, the remoting configuration :
<system.runtime.remoting>
<application>
<channels>
<channel ref="http">
<serverProviders>
<formatter ref="binary" typeFilterLevel="Full" />
</serverProviders>
</channel>
</channels>
</application>
</system.runtime.remoting>

Client side, I get a ref on the remote service by :
_boElementSvc = (IBusinessElementRemoteService)ctx.GetObject("businessElementRemoteService");

This part is OK. Now the problem is when I try to define a property of this service. For exemple :
_boElementSvc.Culture = _Application.Current.CurrentCulture;

I got a ArgumentNullException :
System.ArgumentNullException: No message was deserialized prior to calling the DispatchChannelSink.
Parameter name: requestMsg
at System.Runtime.Remoting.Channels.DispatchChannelSi nk.ProcessMessage(IServerChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream requestStream, IMessage& responseMsg, ITransportHeaders& responseHeaders, Stream& responseStream) at System.Runtime.Remoting.Channels.BinaryServerForma tterSink.ProcessMessage(IServerChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream requestStream, IMessage& responseMsg, ITransportHeaders& responseHeaders, Stream& responseStream) at System.Runtime.Remoting.Channels.Http.HttpHandlerT ransportSink.HandleRequest(HttpContext context) at System.Runtime.Remoting.Channels.Http.HttpRemoting Handler.InternalProcessRequest(HttpContext context)


If anyone has an idea ...

Thanks

Fred

Bruno Baia
06-28-2007, 01:36 PM
Hi,

Check that thread :
Spring + remoting + IIS (http://forum.springframework.net/showthread.php?t=469)

Cheers,
Bruno

DroleDeCerfeuil
06-28-2007, 01:54 PM
Salut Bruno,

I have checked this thread before to post my previous message, and I used your exemple "RemotingUsingWebServer" but the problem was still there ...

However, I've just found an solution :D :

Web.Config file is still the same as above.

Client side, in App.Config file, I've added this remote config section :
<system.runtime.remoting>
<application>
<channels>
<channel ref="http">
<clientProviders>
<formatter ref="binary" typeFilterLevel="Full"/>
</clientProviders>
</channel>
</channels>
</application>
</system.runtime.remoting>

And in the client's initialization code :
RemotingConfiguration.Configure("Client.exe.config");

And now it seams it works fine :p Some tests will confirm or not this ...

Bye

Fred