Beispiel #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);
            }
        }