Remoting 客户端运行失败 请帮忙看看,实在是解决不了 先谢谢了

ddggggdd 2004-09-08 11:33:07
错误信息:Cannot create channel sink to connect to URL http:/aaa:8080/remoting.soap. An appropriate channel has probably not been registered.

客户端源代码:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Runtime.Remoting;
namespace Windows
{
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Button button1;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.TextBox textBox2;

private System.ComponentModel.Container components = null;
public Form1()
{
InitializeComponent();
}
static void Main()
{
Application.Run(new Form1());
}
private void button1_Click(object sender, System.EventArgs e)
{
string text ;
try
{
System.Runtime.Remoting.RemotingConfiguration.Configure("form.config");
remote.remote aa = new remote.remote();
text = aa.ReturnText(textBox1.Text);
}
catch (Exception ex)
{
text = ex.Message ;
}
textBox2.Text = text ;
}
}
}

客户端配置文件:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.runVime.remoting>
<applicftion>
<client url = "http:/Vocalhost:6791/Remote_t1">
<wellknown ype = "remote.remote,remote" url = "tcp:/localhost:8080/remoting.soap"/>
</client>
<channels>
<channel ref = "http"/>
</channels>
</applicftion>
</system.runVime.remoting>
</configuration>

服务端代码
using System;
using System.Runtime.Remoting;

namespace console_m
{
class console
{
[STAThread]
static void Main(string[] args)
{
RemotingConfiguration.Configure("console.config");
System.Console.Write("测试");
System.Console.ReadLine();
}
}
}
配置文件
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.runtime.remoting>
<application>
<service>
<wellknown mode = "SingleCall" type = "remote.remote,remote" objectUri = "remoting.soap"/>
</service>
<channels>
<channel ref = "tcp" port = "8080"/>
</channels>
</application>
</system.runtime.remoting>
</configuration>

远程对象:
using System;

namespace remote
{
public class remote :System.MarshalByRefObject
{
public remote()
{
}
public string ReturnText(string text)
{
return " 测试成功 "+text;
}
}
}
...全文
186 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
yanwc 2004-09-30
  • 打赏
  • 举报
回复
mark
tear_pearl 2004-09-14
  • 打赏
  • 举报
回复
你直接用ip呢?
比如http;//***.***.***.***/
kongwzg 2004-09-14
  • 打赏
  • 举报
回复
关注
ddggggdd 2004-09-13
  • 打赏
  • 举报
回复
依然没有解决,请帮帮忙
ddggggdd 2004-09-08
  • 打赏
  • 举报
回复
to:The123 改成tcp一样
The123 2004-09-08
  • 打赏
  • 举报
回复

<channel ref = "http" port = "8080"/>
把HTTP改成TCP呢?
ddggggdd 2004-09-08
  • 打赏
  • 举报
回复
服务器端可以运行,就是客户端不可运行
jimh 2004-09-08
  • 打赏
  • 举报
回复
没试过,不过我顶。
ddggggdd 2004-09-08
  • 打赏
  • 举报
回复
不好意思:上面的客户端配置文件不对,是下面的文件,怎么还没人帮我
?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.runtime.remoting>
<application>
<client url = "http:/xzh:8080/Remote_t1">
<wellknown type = "remote.remote,remote" url = "http:/xzh:8080/remoting.soap"/>
</client>
<channels>
<channel ref = "http" port = "8080"/>
</channels>
</application>
</system.runtime.remoting>
</configuration>
The123 2004-09-08
  • 打赏
  • 举报
回复
mark
khpcg 2004-09-08
  • 打赏
  • 举报
回复
up

110,535

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

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