.Net Reomting 客户端配置文件不能访问

本文探讨了使用IIS作为宿主机时客户端通过Remoting访问的问题。详细介绍了通过不同方式调用远程服务的方法,并讨论了配置Web.config文件时遇到的访问失败情况。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

宿主机用的是IIS做的,在客户端象如下那样写,就能够访问

None.gif
None.gif            HelloServer obj2 
= (HelloServer)Activator.GetObject(
None.gif                
typeof(ClassLibrary3.HelloServer),
None.gif                
"http://192.168.1.101/remoting/HelloServer.soap");
None.gif            
this.TextBox2.Text = obj2.HelloMethod(this.TextBox1.Text);
但是客户端换成:
None.gif HelloServer obj2=new HelloServer();
None.gif 
None.gif            
this.TextBox2.Text = obj2.HelloMethod(this.TextBox1.Text);
在Web.config里加入如下,确不能正确访问宿主机:
None.gif   <system.runtime.remoting>
None.gif      
<application>
None.gif          
<client>
None.gif        
<!--<wellknown type="HelloServer, General" url="http://localhost:8090/SayHello" />-->
None.gif        
<wellknown
None.gif       mode
="Singleton" 
None.gif         type
="ClassLibrary3.HelloServer,ClassLibrary3" url="http://192.168.1.101/remoting/HelloServer.soap" />
None.gif      
</client>
None.gif         
<channels>
None.gif            
<channel ref="http" useDefaultCredentials="true" />
None.gif         
</channels>
None.gif      
</application>
None.gif   
</system.runtime.remoting>
请大家指教下

转载于:https://www.cnblogs.com/gjahead/archive/2007/06/17/786566.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值