當垮域訪問.net Remoting應用程式時,會出現"The server has rejected the client credentials" 錯誤. 解決方案就是在用戶端類比授權身份登陸.
用戶端代碼寫法
RemotingConfiguration.Configure(@"C:\remotingdemo\Client\Client.exe.config", true);
RemoteObject obj = new RemoteObject();
... ...
設定檔格式:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.runtime.remoting>
<application>
<client>
<wellknown type="RemotingDemo.RemoteObject, General"
url="tcp://binsu-***:8001/GetObject" />
</client>
<channels>
<channel ref="tcp" secure="true"
impersonationLevel="Impersonation" protectionLevel="EncryptAndSign"
username="administrator" password="******" domain="binsu-***">
<clientProviders>
<formatter ref="binary"/>
</clientProviders>
<serverProviders>
<formatter ref="soap" typeFilterLevel="Full" />
<formatter ref="binary" typeFilterLevel="Full" />
</serverProviders>
</channel>
</channels>
</application>
</system.runtime.remoting>
</configuration>
畢!