日期:2014-05-17  浏览次数:20449 次

为什么System.Runtime.Remoting.Channels里没有Http
本帖最后由 rainxies 于 2013-12-02 16:22:02 编辑
我想写一个SOAP CLIENT,
看到网上有这段代码

lizi3.cs
using System;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Http;

class lizi3{
public static void Main(){
HttpChannel hchan = new HttpChannel(0);
ChannelServices.RegisterChannel(hchan);
Object remoteObject = RemotingServices.Connect(typeof(ISimpleObject),"http://localhost:154/SOEndPoint");
ISimpleObject so = remoteObject as ISimpleObject;
Console.WriteLine(so.ToUpper("make this uppercase"));
}
}


其中,
 using System.Runtime.Remoting.Channels.Http;
我就报错了,说命名空间System.Runtime.Remoting.Channels不能存在 Http。
各位大大能帮忙看看吗?谢谢!!!
说明一下,我是在asp.net里开发。

下面是我的代码:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels.Http;

public partial class NET_TEST_t1 : System.Web.UI.Page

------解决方案--------------------
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Http;

删了一行报错,试着还原回去