I am absolutely bewildered now by the
Microsoft.Samples SSPI and Security assemblies. I've
been trying to set these up in a very straightforward
harness in the way that I'd like to be able to use
them. No IIS. Use TCP, binary. Standard server example
with a console host and console client. .NET 1.1,
windows XP, NTLM.

I've looked all over, trying to figure out what is
going on. I've come across people reporting similar
issues, but no resolution ever seems to be posted in
response. The Host seems to start up fine and be
listening. The constructor for the server object even
seems to be called ok. The code for a particular
method/property even seems to execute (based on debug
ouput). I've traced the error into the
ChannelSinkCallContext.DeserializeStringToChannelSinkCallContext
shown in the dump. For some reason, at some point, a
call to nextSink.ProcessMessage returns
responseHeaders with no "ChannelSinkCallContext"
header and this in turn passes on to
DeserializeStringToChannelSinkCallContext as a null
which blows up when Convert.FromBase64String tries to
operate on it.

I've tried everything I can think of in the config
files. any suggestions? If I comment out the provider
entities in the below configs everything runs great.
As soon as I try to enable the Security assembly, it
blows chunks. Does it not work with Framework 1.1? XP?
Does it still require hosting in IIS or something?

Below is a stack trace, config files, and way simple
code for server, host, and client.

Everytime I try to call a method or property I end up
with:

Unhandled Exception: System.ArgumentNullException:
Value cannot be null.
Parameter name: InString

Server stack trace:
   at System.Convert.FromBase64String(String s)
   at
Microsoft.Samples.Runtime.Remoting.Security.ChannelSinkCallContext.DeserializeStringToChannelSinkCallContext(String
serializedGraph) in
d:\code\msremote\security\securitysink.cs:line 404
   at
Microsoft.Samples.Runtime.Remoting.Security.SecurityChannelSink.SendMessageToServerSink(ClientContext
clientContext, IClientChannelSink nextSink,
ChannelSinkCallContext channelSinkCallContext,
IMessage msg, ITransportHeaders requestHeaders, Stream
requestStream, ITransportHeaders&responseHeaders,
Stream& responseStream) in
d:\code\msremote\security\securitysink.cs:line 643
   at
Microsoft.Samples.Runtime.Remoting.Security.SecurityClientChannelSink.ProcessMessage(IMessage
msg, ITransportHeaders requestHeaders,
StreamrequestStream, ITransportHeaders&
responseHeaders, Stream&responseStream) in
d:\code\msremote\security\securitysink.cs:line 940
   at
System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage(IMessage
msg)

Exception rethrown at [0]:
   at
System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessagereqMsg,
IMessage retMsg)
   at
System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&msgData,
Int32 type)
   at Server.ServerEx.DoNothing() in
d:\code\msremote\server\serverex.cs:line 20
   at Client.ClientEx.Main() in
D:\Code\MSRemote\Client\ClientEx.cs:line 13

<!-- Server Config -->
<configuration>
 <system.runtime.remoting>
  <debug loadTypes="true" />

  <application>

   <channels>
    <channel ref="tcp" port="8080">
     <serverProviders>
      <formatter ref="binary" typeFilterLevel="Full"
/>
      <provider
type="Microsoft.Samples.Runtime.Remoting.Security.SecurityServerChannelSinkProvider,
Microsoft.Samples.Runtime.Remoting.Security"
       securityPackage="ntlm"
authenticationLevel="call" />
     </serverProviders>
    </channel>
   </channels>

   <service>
    <wellknown mode="Singleton" type="Server.ServerEx,
Server" objectUri="Server.rem"/>
   </service>

  </application>

 </system.runtime.remoting>
</configuration>
--------------------------------------------------------
<!-- Client Config -->
<configuration>
 <system.runtime.remoting>
  <debug loadTypes="true" />

  <application>

   <channels>
    <channel ref="tcp">
     <clientProviders>
      <formatter ref="binary" />
      <provider
type="Microsoft.Samples.Runtime.Remoting.Security.SecurityClientChannelSinkProvider,
Microsoft.Samples.Runtime.Remoting.Security"
       securityPackage="ntlm"
impersonationLevel="impersonate"
authenticationLevel="call" />
     </clientProviders>
    </channel>
   </channels>

   <client>
    <wellknown type="Server.ServerEx, Server"
url="tcp://localhost:8080/Server.rem"/>
   </client>

  </application>

 </system.runtime.remoting>
</configuration>
---------------------------------------------------------------
// server code
using System;
using System.Diagnostics;
namespace Server {
 public class ServerEx : MarshalByRefObject {

  private DateTime _dt = DateTime.Now;

  public ServerEx() {
   Debug.WriteLine("constructor");
  }

  public void DoNothing() {
   Debug.WriteLine("did nothing");
  }

  public DateTime CreateTime {
   get {
    return _dt;
   }
  }
 }
}
------------------------------------------------------------------
// host code
using System;
using System.Runtime.Remoting;
namespace Host {
 public class HostEx {
  public static void Main(){
   RemotingConfiguration.Configure("Host.exe.config");
   Console.WriteLine("Listening for requests. Press
Enter to exit...");
   Console.ReadLine();
  }
 }
}
----------------------------------------------------------------
//client code
using System;
using System.Runtime.Remoting;
namespace Client {
 public class ClientEx {
  public static void Main(){

RemotingConfiguration.Configure("Client.exe.config");
   Server.ServerEx remoteObject = new
Server.ServerEx();
   remoteObject.DoNothing();
   remoteObject.DoNothing();
   remoteObject.DoNothing();
   Console.WriteLine(remoteObject.CreateTime);
   Console.ReadLine();
  }
 }
}

__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

===================================
This list is hosted by DevelopMentorŪ  http://www.develop.com
NEW! ASP.NET courses you may be interested in:

2 Days of ASP.NET, 29 Sept 2003, in Redmond
http://www.develop.com/courses/2daspdotnet

Guerrilla ASP.NET, 13 Oct 2003, in Boston
http://www.develop.com/courses/gaspdotnet

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

Reply via email to