Hi all,

I have a dll hosted by IIS that exposes a Well-known singleton.  A client
can connect to that object fine, call a method on it and recieve a
reference to another MarshalByRefObject (a Stream in this case).  But as
soon as the client tries to call a method on the returned object, a
WebException is thrown with the message "(403) Forbidden".

eg:
IServer server = (IServer)Activator.GetObject(/* blah */);
Stream strm = server.CreateStream(/* blah */);
int firstbyte = strm.ReadByte(); // <-- WebException thrown here

I previously had this setup working fine on another machine, with the
client either local or across a network.  But since it was using the same
channels/providers and IIS, I don't think this is the problem.

Permissions for IIS seem to be fine, both .rem and .soap support the
necessary verbs etc.  There are no firewalls or proxies in the way.
URLScan is running, but from the log it doesn't seem to be blocking these
requests.  And from the weblogs, the requests to the Stream objects never
seem to be even made...

So after much hair pulling and head banging, I whacked a remoting probe
into the sink chain and started to step through.  This is what seems to be
happening:
1) The call to Activator.GetObject() works without actually sending a
request, as expected.
2) The call to server.CreateStream() runs, an entry appears in the
weblogs, and the return message contains what looks like a WebException.
But the call succeeds, and a reference is returned.
3) The call to strm.ReadByte() throws the WebException without actually
sending any information down the pipe.  So no entry appears in the logs.

So, I'm now at the point where I know the problem is not with the second
remote call, but something is wrong with the first.  Except, from what I
can see the first method call returns normally as far as the server is
concerned.  And I have no idea why the excpetion isn't thrown immediatly.

If anyone can shed any light on this, it would be greatly appreciated.

Thanks,

Andy

===================================
This list is hosted by DevelopMentor�  http://www.develop.com
You may be interested in Guerrilla .NET, 24 March 2003, in London and Boston
http://www.develop.com/courses/gdotnet

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to