コード例 #1
0
        /// <summary>
        /// 根据绑定中的协议类型调用不同的实现方法
        /// </summary>
        /// <param name="state"></param>
        /// <returns></returns>
        private static JN.ESB.Schemas.务响应 CallService(CallState callState)
        {
            switch (callState.Binding.BindingType)
            {
            case (int)BindingType.WebService:
                return(SoapClient.CallWebService(callState));

            case (int)BindingType.REST:
                return(RestfulClient.CallRestfulService(callState));

            case (int)BindingType.ASHX:
                return(HandlerClient.CallAshxService(callState));

            case (int)BindingType.WCF_HTTP:
                return(WcfClient.CallWcfService(callState));

            default:
                throw LogUtil.ExceptionAndLog(callState, "未知的绑定类型", callState.Binding.BindingType.ToString(), callState.Binding, callState.Request);
            }
        }
コード例 #2
0
ファイル: GateClient.cs プロジェクト: ly774508966/cosmos
 public GateClient(string host, int port)
 {
     _gateClient = new HandlerClient(host, port);
 }
コード例 #3
0
 public PlayerHandlerClient(string host, int port, int subcribePort)
 {
     _handlerClient = new HandlerClient(host, port, subcribePort);
     SubcribePlayer();
 }