.Net Remoting 的问题,请教各位.

shyuan 2005-09-28 06:23:18
服务器端我这样写:
TcpServerChannel channel = new TcpServerChannel(8080);
ChannelServices.RegisterChannel(channel);

RemotingConfiguration.ApplicationName = "VATPService";

RemotingConfiguration.RegisterWellKnownServiceType(typeof(SMARTSInvoice),
"SMARTSInvoice", WellKnownObjectMode.SingleCall);
客户端能正常调用SMARTSInvoice对象.

但服务器端改成:
RemotingConfiguration.Configure("ServiceConsole.exe.config");
客户端却调用失败:Requested Service not found.

我的server端配置有问题,但我却找不到:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.runtime.remoting>
<application>
<service name="VATPService">
<wellknown mode="SingleCall" type="VATP.BLL.SMARTSInvoice, VATP.BLL" objectUri="SMARTSInvoice" />
</service>
<channels>
<channel ref="tcp server" port="8080" />
</channels>
</application>
</system.runtime.remoting>
</configuration>

VATP.BLL是SMARTSInvoice对象的程序集.
谁能帮忙看看.谢谢.
...全文
196 16 打赏 收藏 转发到动态 举报
写回复
用AI写文章
16 条回复
切换为时间正序
请发表友善的回复…
发表回复
hanmlxiao 2005-09-30
  • 打赏
  • 举报
回复
objectUri="SMARTSInvoice.rem"
shyuan 2005-09-30
  • 打赏
  • 举报
回复
To lee_wei: 还是不行.:( objectUri 不是别名吗?
lee_wei 2005-09-30
  • 打赏
  • 举报
回复
<wellknown mode="SingleCall" type="VATP.BLL.SMARTSInvoice, VATP.BLL" objectUri="SMARTSInvoice" />
应该是:
<wellknown mode="SingleCall" type="VATP.BLL.SMARTSInvoice, VATP.BLL" objectUri="VATP.BLL.SMARTSInvoice" />
lee_wei 2005-09-30
  • 打赏
  • 举报
回复
应该是:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.runtime.remoting>
<application name="VATPService">
<service>
<wellknown mode="SingleCall" type="VATP.BLL.SMARTSInvoice, VATP.BLL" objectUri="SMARTSInvoice" />
</service>
<channels>
<channel ref="tcp server" port="8080" />
</channels>
</application>
</system.runtime.remoting>
</configuration>
jijl2001 2005-09-30
  • 打赏
  • 举报
回复
不懂,推荐一本书看看
shyuan 2005-09-30
  • 打赏
  • 举报
回复
在线继续关注中...
lee_wei 2005-09-30
  • 打赏
  • 举报
回复
faint!
我不都说了吗,呵呵
shyuan 2005-09-30
  • 打赏
  • 举报
回复
偶找到了!!! 是application name而不是service name. faint!
DalyQiao 2005-09-29
  • 打赏
  • 举报
回复
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.runtime.remoting>
<application name="Client">
<client url="tcp://qch:6791" >
<wellknown type="ServerLib.LoginAuth,ServerLib" url="tcp://qch:6791/PW" />
<wellknown type="ServerLib.Dept,ServerLib" url="tcp://qch:6791/PP" />
</client>
<channels>
<channel ref="tcp" port="0">
</channel>
</channels>
</application>
</system.runtime.remoting>
</configuration>
DalyQiao 2005-09-29
  • 打赏
  • 举报
回复
我也遇到过类似的问题,不过我把Uri改短后就好了,不明白是为什么
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.runtime.remoting>
<application name="Server">
<service>
<wellknown type="ServerLib.LoginAuth,ServerLib" objectUri="PW" mode="Singleton" />
<wellknown type="ServerLib.Dept,ServerLib" objectUri="PP" mode="Singleton" />
</service>
<channels>
<channel ref="tcp" port="6791">
<serverProviders>
<formatter ref="binary" typeFilterLevel="Full" />
</serverProviders>
</channel>
</channels>
</application>
</system.runtime.remoting>
</configuration>
shyuan 2005-09-29
  • 打赏
  • 举报
回复
在线关注中..
shyuan 2005-09-29
  • 打赏
  • 举报
回复
Uri改短后还是一样.. 郁闷..
lovelife_821106 2005-09-29
  • 打赏
  • 举报
回复
<channel ref="tcp" port="0">
--------------------------------
端口有可能会引起冲突的
wirte 2005-09-28
  • 打赏
  • 举报
回复
职业顶贴
hjhgjuu 2005-09-28
  • 打赏
  • 举报
回复
不懂,帮你up
shyuan 2005-09-28
  • 打赏
  • 举报
回复
没人看? 偶自己顶!

12,162

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 Web Services
社区管理员
  • Web Services社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧