Ejemplo n.º 1
0
 public HisProviderH00021()
 {
     if (_HISClient == null)
     {
         _HISClient = new RequestWsProvider <IHisApplay>("H" + _HOSPITALID).ReqClient;
     }
 }
Ejemplo n.º 2
0
 public HisProviderH00020()
 {
     try
     {
         if (_HISClient == null)
         {
             _HISClient = new RequestWsProvider <IHisApplay>("H" + _HOSPITALID).ReqClient;
         }
         if (WS == null)
         {
             WS = new WebServiceAgent("HisUrl".ConfigValue());
         }
     }
     catch (Exception)
     {
     }
 }
Ejemplo n.º 3
0
        public static string Call(string url, string methodName, params string[] args)
        {
            BasicHttpBinding binding = new BasicHttpBinding();

            binding.ReaderQuotas = new XmlDictionaryReaderQuotas()
            {
                MaxStringContentLength = 2147483647
            };
            EndpointAddress endpoint = new EndpointAddress(url);

            using (ChannelFactory <IHisApplay> channelFactory = new ChannelFactory <IHisApplay>(binding, endpoint))
            {
                IHisApplay instance = channelFactory.CreateChannel();
                using (instance as IDisposable)
                {
                    try
                    {
                        string TradeOut = string.Empty;
                        instance.RunService(args[0], args[1], ref TradeOut);
                        return(TradeOut);

                        //Type type = typeof(IHisApplay);
                        //MethodInfo mi = type.GetMethod(methodName);
                        //mi.Invoke(instance, args);
                        //return args[2].ToString();
                    }
                    catch (TimeoutException tErr)
                    {
                        (instance as ICommunicationObject).Abort();
                        throw tErr;
                    }
                    catch (CommunicationException cErr)
                    {
                        (instance as ICommunicationObject).Abort();
                        throw cErr;
                    }
                    catch (Exception vErr)
                    {
                        (instance as ICommunicationObject).Abort();
                        throw vErr;
                    }
                }
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// ping通网络测试
        /// </summary>
        /// <returns></returns>
        public static void PingCall(ref System.DateTime TradeMsgOut)
        {
            BasicHttpBinding binding = new BasicHttpBinding();

            binding.ReaderQuotas = new XmlDictionaryReaderQuotas()
            {
                MaxStringContentLength = 2147483647
            };
            EndpointAddress endpoint = new EndpointAddress(WCFaddr);

            using (ChannelFactory <IHisApplay> channelFactory = new ChannelFactory <IHisApplay>(binding, endpoint))
            {
                IHisApplay instance = channelFactory.CreateChannel();
                using (instance as IDisposable)
                {
                    try
                    {
                        TradeMsgOut = instance.PCall();
                        // return TradeMsgOut;
                    }
                    catch (TimeoutException tErr)
                    {
                        (instance as ICommunicationObject).Abort();
                        throw tErr;
                    }
                    catch (CommunicationException cErr)
                    {
                        (instance as ICommunicationObject).Abort();
                        throw cErr;
                    }
                    catch (Exception vErr)
                    {
                        (instance as ICommunicationObject).Abort();
                        throw vErr;
                    }
                }
            }
        }