Exemplo n.º 1
0
 public void Dispose()
 {
     if (_client != null)
     {
         try
         {
             _client.Close();
         }
         catch
         {
         }
         _client = null;
     }
 }
Exemplo n.º 2
0
        public GeocachingLiveV6(bool testSite)
        {

            BinaryMessageEncodingBindingElement binaryMessageEncoding = new BinaryMessageEncodingBindingElement()
            {
                ReaderQuotas = new XmlDictionaryReaderQuotas()
                {
                    MaxStringContentLength = int.MaxValue,
                    MaxBytesPerRead = int.MaxValue,
                    MaxDepth = int.MaxValue,
                    MaxArrayLength = int.MaxValue
                }
            };

            HttpTransportBindingElement httpTransport = new HttpsTransportBindingElement()
            {
                MaxBufferSize = int.MaxValue,
                MaxReceivedMessageSize = int.MaxValue,
                AllowCookies = false,
                //UseDefaultWebProxy = true,
            };

            // add the binding elements into a Custom Binding
            CustomBinding binding = new CustomBinding(binaryMessageEncoding, httpTransport);

            EndpointAddress endPoint;
            if (testSite)
            {
                endPoint = new EndpointAddress("https://staging.api.groundspeak.com/Live/V6Beta/geocaching.svc/Silverlightsoap");
                _token = Core.Settings.Default.LiveAPITokenStaging;
            }
            else
            {
                endPoint = new EndpointAddress("https://api.groundspeak.com/LiveV6/Geocaching.svc/Silverlightsoap");
                _token = Core.Settings.Default.LiveAPIToken;
            }

            try
            {
                _client = new LiveV6.LiveClient(binding, endPoint);
            }
            catch(Exception e)
            {
                Core.ApplicationData.Instance.Logger.AddLog(this, e);
            }

        }
Exemplo n.º 3
0
        public GeocachingLiveV6(Framework.Interfaces.ICore core, bool testSite)
        {
            _core = core;

            BinaryMessageEncodingBindingElement binaryMessageEncoding = new BinaryMessageEncodingBindingElement()
            {
                ReaderQuotas = new XmlDictionaryReaderQuotas()
                {
                    MaxStringContentLength = int.MaxValue,
                    MaxBytesPerRead = int.MaxValue,
                    MaxDepth = int.MaxValue,
                    MaxArrayLength = int.MaxValue
                }
            };

            HttpTransportBindingElement httpTransport = new HttpsTransportBindingElement() 
            { 
                MaxBufferSize = int.MaxValue, 
                MaxReceivedMessageSize = int.MaxValue,
                AllowCookies = false, 
            };

            // add the binding elements into a Custom Binding
            CustomBinding binding = new CustomBinding(binaryMessageEncoding, httpTransport);            

            EndpointAddress endPoint;
            if (testSite)
            {
                endPoint = new EndpointAddress("https://staging.api.groundspeak.com/Live/V6Beta/geocaching.svc/Silverlightsoap");
                _token = core.GeocachingComAccount.APITokenStaging;
            }
            else
            {
                endPoint = new EndpointAddress("https://api.groundspeak.com/LiveV6/Geocaching.svc/Silverlightsoap");
                _token = core.GeocachingComAccount.APIToken;
            }

            try
            {
                _client = new LiveV6.LiveClient(binding, endPoint);
            }
            catch
            {
            }

        }
Exemplo n.º 4
0
        public GeocachingLiveV6(Framework.Interfaces.ICore core, bool testSite)
        {
            _core = core;

            BinaryMessageEncodingBindingElement binaryMessageEncoding = new BinaryMessageEncodingBindingElement()
            {
                ReaderQuotas = new XmlDictionaryReaderQuotas()
                {
                    MaxStringContentLength = int.MaxValue,
                    MaxBytesPerRead        = int.MaxValue,
                    MaxDepth       = int.MaxValue,
                    MaxArrayLength = int.MaxValue
                }
            };

            HttpTransportBindingElement httpTransport = new HttpsTransportBindingElement()
            {
                MaxBufferSize          = int.MaxValue,
                MaxReceivedMessageSize = int.MaxValue,
                AllowCookies           = false,
            };

            // add the binding elements into a Custom Binding
            CustomBinding binding = new CustomBinding(binaryMessageEncoding, httpTransport);

            EndpointAddress endPoint;

            if (testSite)
            {
                endPoint = new EndpointAddress("https://staging.api.groundspeak.com/Live/V6Beta/geocaching.svc/Silverlightsoap");
                _token   = core.GeocachingComAccount.APITokenStaging;
            }
            else
            {
                endPoint = new EndpointAddress("https://api.groundspeak.com/LiveV6/Geocaching.svc/Silverlightsoap");
                _token   = core.GeocachingComAccount.APIToken;
            }

            try
            {
                _client = new LiveV6.LiveClient(binding, endPoint);
            }
            catch
            {
            }
        }
Exemplo n.º 5
0
        public GeocachingLiveV6(bool testSite)
        {
            BinaryMessageEncodingBindingElement binaryMessageEncoding = new BinaryMessageEncodingBindingElement()
            {
                ReaderQuotas = new XmlDictionaryReaderQuotas()
                {
                    MaxStringContentLength = int.MaxValue,
                    MaxBytesPerRead        = int.MaxValue,
                    MaxDepth       = int.MaxValue,
                    MaxArrayLength = int.MaxValue
                }
            };

            HttpTransportBindingElement httpTransport = new HttpsTransportBindingElement()
            {
                MaxBufferSize          = int.MaxValue,
                MaxReceivedMessageSize = int.MaxValue,
                AllowCookies           = false,
                //UseDefaultWebProxy = true,
            };

            // add the binding elements into a Custom Binding
            CustomBinding binding = new CustomBinding(binaryMessageEncoding, httpTransport);

            EndpointAddress endPoint;

            if (testSite)
            {
                endPoint = new EndpointAddress("https://staging.api.groundspeak.com/Live/V6Beta/geocaching.svc/Silverlightsoap");
                _token   = Core.Settings.Default.LiveAPITokenStaging;
            }
            else
            {
                endPoint = new EndpointAddress("https://api.groundspeak.com/LiveV6/Geocaching.svc/Silverlightsoap");
                _token   = Core.Settings.Default.LiveAPIToken;
            }

            try
            {
                _client = new LiveV6.LiveClient(binding, endPoint);
            }
            catch (Exception e)
            {
                Core.ApplicationData.Instance.Logger.AddLog(this, e);
            }
        }
Exemplo n.º 6
0
 public void Dispose()
 {
     if (_client != null)
     {
         try
         {
             _client.Close();
         }
         catch
         {
         }
         _client = null;
     }
 }