Ejemplo n.º 1
0
        private String UploadToServer(String address, byte[] testData, String ksign, String JSDWCode)
        {
            String result = "";

            logger.Error(string.Format("运行到UploadToServer"));
            return("1");

            try
            {
                using (ChannelFactory <IDataTransport> channelFactory =
                           new ChannelFactory <IDataTransport>("uploadEP", new EndpointAddress(address)))
                {
                    IDataTransport proxy = channelFactory.CreateChannel();
                    using (proxy as IDisposable)
                    {
                        result = proxy.ReciveTestData(testData, ksign, JSDWCode);
                    }
                }
            }
            catch (Exception ex)
            {
                logger.Error("调用远程服务错误:" + ex.Message);
            }
            return(result);
        }
Ejemplo n.º 2
0
        private String UploadToServer(String address, byte[] testData, String ksign, String JSDWCode)
        {
            String result = "";

            try
            {
                using (ChannelFactory <IDataTransport> channelFactory =
                           new ChannelFactory <IDataTransport>("uploadEP", new EndpointAddress(address)))
                {
                    IDataTransport proxy = channelFactory.CreateChannel();
                    using (proxy as IDisposable)
                    {
                        result = proxy.ReciveTestData(testData, ksign, JSDWCode);
                    }
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
            }

            return(result);
        }