Re: Cannot create channel sink
- From: Loyola stalin <Loyolastalin@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 26 Jun 2006 06:21:02 -0700
Hi Dave Sexton,
I found the solution..
Thz for ur kind help ..
"Dave Sexton" wrote:
Hi Loyola,.
Is "vsdt1249" the name of the computer that executes the code calling
StartServer()?
- Dave Sexton
"Loyola stalin" <Loyolastalin@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:E0368771-47C2-4648-A245-EB763F80CDFB@xxxxxxxxxxxxxxxx
Hi SexTon ,
I have one more problem,
I just let you know the sample Code which I have, for the better
understanding of my code
In server side
namespace ServerApplication
{
class RMI
{
public RMI()
{
}
public static void StartServer()
{
System.Runtime.Remoting.Channels.BinaryServerFormatterSinkProvider
serverProv
= new
System.Runtime.Remoting.Channels.BinaryServerFormatterSinkProvider();
serverProv.TypeFilterLevel =
System.Runtime.Serialization.Formatters.TypeFilterLevel.Full;
System.Runtime.Remoting.Channels.BinaryClientFormatterSinkProvider cleProv
=
new System.Runtime.Remoting.Channels.BinaryClientFormatterSinkProvider();
System.Collections.IDictionary props = new
System.Collections.Hashtable();
props["port"] = 8080;
props["machineName"] = "vsdt1249";
System.Runtime.Remoting.Channels.ChannelServices.RegisterChannel(new
HttpChannel(props, cleProv, serverProv), false);
MyObj ob = new MyObj();
System.Runtime.Remoting.RemotingServices.Marshal(ob,
"SortedSearchable");
}
}
Client Side
IRemote ob1 = (IRemote)Activator.GetObject(typeof(IRemote),
@"http://vsdt1249:8080/SortedSearchable");
MessageBox.Show(ob1.DispName("Loyola stalin"));
Client App.config
-------------------------
<configuration>
<system.runtime.remoting>
<application>
<channels>
<channel ref="http" port="0">
<clientProviders>
<formatter ref="binary" />
</clientProviders>
<serverProviders>
<formatter ref="binary" typeFilterLevel="Full" />
</serverProviders>
</channel>
</channels>
<client>
<!-- ... Add your classes here ... -->
</client>
</application>
</system.runtime.remoting>
</configuration>
Object Dll
namespace RemoteObjects
{
[Serializable]
public class MyObj : MarshalByRefObject, IRemote
{
public string DispName(string strName)
{
return "Ur name is " + strName;
}
}
public interface IRemote
{
string DispName(string strName);
}
}
I am runing client application and server appliaction
My Application throws an error like
System.ArgumentNullException: No message was deserialized prior to calling
the DispatchChannelSink.
Parameter name: requestMsg
at
System.Runtime.Remoting.Channels.DispatchChannelSink.ProcessMessage(IServerChannelSinkStack
sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream
requestStream, IMessage& responseMsg, ITransportHeaders& responseHeaders,
Stream& responseStream)
at
System.Runtime.Remoting.Channels.BinaryServerFormatterSink.ProcessMessage(IServerChannelSinkStack
sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream
requestStream, IMessage& responseMsg, ITransportHeaders& responseHeaders,
Stream& responseStream)
at
System.Runtime.Remoting.Channels.Http.HttpServerTransportSink.ServiceRequest(Object
state)
at System.Runtime.Remoting.Channels.SocketHandler.ProcessRequestNow()
if I include a App.Config in the server side :
Server App.Config
<system.runtime.remoting>
<application>
<service>
<activated type="RemoteObjects.MyObj, RemoteObjects" />
</service>
</application>
</system.runtime.remoting>
Client application is does't throw any error as well as out put ?
Please tell me the way ..
Thanks and Regards
Loyola
"Dave Sexton" wrote:
Hi Loyola,
To specify a host name or I.P. address for a remote object you must do so
in
the channel object's constructor using the IDictionary of properties.
Here is a list of the properties that are available for each channel:
http://msdn2.microsoft.com/en-us/library/kw7c6kwc.aspx
I believe you want to use the machineName property, but you can't
specify
an IP address or host name for a machine other than the one that is
executing the code.
HTH
"Loyola stalin" <Loyolastalin@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:3C7BCC0E-FAE3-4F4C-8D10-6FC51F33547B@xxxxxxxxxxxxxxxx
Hi,
I am trying to store my object in remote system
Like System.Runtime.Remoting.RemotingServices.Marshal(ob,
"//10.31.180.50/SortedSearchable");
And Retreving like
(IRemote)Activator.GetObject(typeof(IRemote),
@"//10.31.180.50:8080/SortedSearchable")
It doesn't work .. But the folowinf working fine ..
System.Runtime.Remoting.RemotingServices.Marshal(ob,
"SortedSearchable");
(IRemote)Activator.GetObject(typeof(IRemote),
@"http://localhost:8080/SortedSearchable");
Can u just tell me how to set the service in a remote system ?
Thanks and Regards
Loyola
- References:
- Cannot create channel sink
- From: Loyola stalin
- Re: Cannot create channel sink
- From: Dave Sexton
- Re: Cannot create channel sink
- From: Loyola stalin
- Re: Cannot create channel sink
- From: Dave Sexton
- Re: Cannot create channel sink
- From: Dave Sexton
- Re: Cannot create channel sink
- From: Loyola stalin
- Re: Cannot create channel sink
- From: Dave Sexton
- Cannot create channel sink
- Prev by Date: Microsoft.Samples.Runtime.Remoting.Security.SecuritySinkMessageHeaderException
- Next by Date: Re: How to configure two separate sets of remoted objects
- Previous by thread: Re: Cannot create channel sink
- Next by thread: Can create server programmatically, but not with config file....
- Index(es):
Relevant Pages
|