public class Remoting { private static readonly string objectUri = "Flight.IntFare.ComputeService.rem"; public static void Start() { RemotingConfiguration.RegisterWellKnownServiceType( typeof(FlightFare.IntFarePlatform.ComputeService.ComputeEngine), objectUri, WellKnownObjectMode.SingleCall); BinaryServerFormatterSinkProvider serverProvider = new BinaryServerFormatterSinkProvider(); BinaryClientFormatterSinkProvider clientProvider = new BinaryClientFormatterSinkProvider(); serverProvider.TypeFilterLevel = TypeFilterLevel.Full; IDictionary props = new Hashtable(); props["name"] = "tcp" + ComputeManager.EnvironmentInfo.Port; props["port"] = ComputeManager.EnvironmentInfo.Port; TcpChannel channel = new TcpChannel(props, clientProvider, serverProvider); ChannelServices.RegisterChannel(channel, false); } }
现在系统里用的是这样的,不晓得咋搞成HTTP协议的,不懂啊,大神们有啥好的建议吗