Remoting authentication problem

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: DavePokl (DavePokl_at_discussions.microsoft.com)
Date: 06/22/04


Date: Tue, 22 Jun 2004 03:09:02 -0700

Hi,

I have a three tier application. The presentation layer is done with WinForms, business layer is done as remoting server hosted in IIS (HTTP channel with binary serialization) and data layer is on SQL Server database.

My virtual application (IIS on WinXP Professional) is set to use Windows authentication.

My web.config contains:
        <authentication mode="Windows" />
        <identity impersonate="true" />

My client code contains:
    HttpClientChannel channel = new HttpClientChannel("tstServer", new BinaryClientFormatterSinkProvider());
    ChannelServices.RegisterChannel(channel);
    RemotingConfiguration.RegisterWellKnownClientType(typeof(TestServer), "http://localhost/TestApp/TestServer.rem");
    
    TestServer server = new TestServer();
    IDictionary channelProperties;
    channelProperties = ChannelServices.GetChannelSinkProperties(facade);
    channelProperties ["credentials"] = System.Net.CredentialCache.DefaultCredentials;
    
    server.Method1();
    server.Method2();
    ...

The application seems to work fine but the performance is not good. When I look in IIS log file I can see the following lines:
    09:21:23 10.32.161.115 POST /TestApp/TestServer.rem 401 4766 427 380
    09:21:25 10.32.161.115 POST /TestApp/TestServer.rem 200 540 518 1321
    09:21:25 10.32.161.115 POST /TestApp/TestServer.rem 401 4766 638 351
    09:21:25 10.32.161.115 POST /TestApp/TestServer.rem 200 2198 753 381
    09:21:31 10.32.161.115 POST /TestApp/TestServer.rem 401 4766 638 351
    09:21:32 10.32.161.115 POST /TestApp/TestServer.rem 200 2257 753 1201
    09:21:32 10.32.161.115 POST /TestApp/TestServer.rem 401 4766 638 351
    09:21:34 10.32.161.115 POST /TestApp/TestServer.rem 200 2257 753 1682
    09:21:34 10.32.161.115 POST /TestApp/TestServer.rem 401 4766 638 361
    09:21:34 10.32.161.115 POST /TestApp/TestServer.rem 200 2198 753 80
    09:21:34 10.32.161.115 POST /TestApp/TestServer.rem 401 4766 638 351
    09:21:34 10.32.161.115 POST /TestApp/TestServer.rem 200 2198 753 60
    09:21:36 10.32.161.115 POST /TestApp/TestServer.rem 401 4766 638 350
    09:21:37 10.32.161.115 POST /TestApp/TestServer.rem 200 2257 753 1723
    09:21:37 10.32.161.115 POST /TestApp/TestServer.rem 401 4766 638 350
    09:21:39 10.32.161.115 POST /TestApp/TestServer.rem 200 2257 753 1683
    09:21:39 10.32.161.115 POST /TestApp/TestServer.rem 401 4766 638 350
    09:21:39 10.32.161.115 POST /TestApp/TestServer.rem 200 2198 753 80
    09:21:39 10.32.161.115 POST /TestApp/TestServer.rem 401 4766 638 351
    09:21:39 10.32.161.115 POST /TestApp/TestServer.rem 200 2198 753 60
    09:21:41 10.32.161.115 POST /TestApp/TestServer.rem 401 4766 638 350
    09:21:42 10.32.161.115 POST /TestApp/TestServer.rem 200 2257 753 1773

Why do I still have 401 - 200. I thought I would have 401 and then just 200s. What is wrong with my code? Can I get rid of the 401s?

Thank you very much for any help or suggestion.

Regards,
Dave.



Relevant Pages