[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Jan

10/6/2004 10:09:00 PM

I've got a windows service acting as a que manager

I want to expose the AddItem/Remove item from different apps. (asp.net and
windows forms)

I've created a windows test application from which I'm able to call the
remote methods, but when I try to use the exact same code from my web app I
always get a receiver not registered exception. If I go back to the windows
client I now get the same exception, and have to restart the service to make
the remote calls work again.

Server(service) side code:
TcpChannel tcpCnl = new TcpChannel(_rport);
ChannelServices.RegisterChannel(tcpCnl);
qm = new QueManager(this);
RemotingServices.Marshal(qm,"QueManager");

Client side code:
TcpChannel chan = new TcpChannel();
ChannelServices.RegisterChannel(chan);
try
{
IQueManager qm =
(IQueManager)Activator.GetObject(typeof(IQueManager),"tcp://"+server+":"+port+"/QueManager");
qm.AddItem(itemid);
}


Any tips will be greatly appreciated.
--
Do or die..
1 Answer

Ken Kolda

10/6/2004 10:54:00 PM

0

Have you overriden InitializeLifetimeServices() in your QueManager class to
return null? It sounds like your object's lease may be expiring. If that's
not the problem, is your server performing any type of callback to the
client (e.g. events)? A possibility is that your server is trying to call
back to your client but your client hasn't registered a server channel to
listen on.

If all else fails, post the entire content of the exception to help diagnose
the problem.

Ken


"Jan" <jango@newsgroup.nospam> wrote in message
news:A1C7BC0D-1349-4762-991F-9FAC39630616@microsoft.com...
> I've got a windows service acting as a que manager
>
> I want to expose the AddItem/Remove item from different apps. (asp.net and
> windows forms)
>
> I've created a windows test application from which I'm able to call the
> remote methods, but when I try to use the exact same code from my web app
I
> always get a receiver not registered exception. If I go back to the
windows
> client I now get the same exception, and have to restart the service to
make
> the remote calls work again.
>
> Server(service) side code:
> TcpChannel tcpCnl = new TcpChannel(_rport);
> ChannelServices.RegisterChannel(tcpCnl);
> qm = new QueManager(this);
> RemotingServices.Marshal(qm,"QueManager");
>
> Client side code:
> TcpChannel chan = new TcpChannel();
> ChannelServices.RegisterChannel(chan);
> try
> {
> IQueManager qm =
>
(IQueManager)Activator.GetObject(typeof(IQueManager),"tcp://"+server+":"+por
t+"/QueManager");
> qm.AddItem(itemid);
> }
>
>
> Any tips will be greatly appreciated.
> --
> Do or die..