Exemplo n.º 1
0
 /// <summary>
 /// Basic Http Binding constructor
 /// </summary>
 /// <param name="username">The UserName username</param>
 /// <param name="password">The UserName password</param>
 /// <param name="usernameWindows">The Windows ClientCredential username</param>
 /// <param name="passwordWindows">The Windows ClientCredential password</param>
 /// <param name="clientCertificate">The client x509 certificate.</param>
 /// <param name="validationMode">An enumeration that lists the ways of validating a certificate.</param>
 /// <param name="x509CertificateValidator">The certificate validator. If null then the certificate is always passed.</param>
 public MessageClient(
     string username                                   = null, string password = null,
     string usernameWindows                            = null, string passwordWindows = null,
     X509Certificate2 clientCertificate                = null,
     X509CertificateValidationMode validationMode      = X509CertificateValidationMode.Custom,
     X509CertificateValidator x509CertificateValidator = null) :
     base(
         new Uri(Nequeo.Net.Properties.Settings.Default.MessageClientBaseAddress),
         new System.ServiceModel.BasicHttpBinding()
 {
     MaxReceivedMessageSize = Nequeo.Net.Properties.Settings.Default.MessageClientMaxReceivedMessageSize,
     TransferMode           = System.ServiceModel.TransferMode.Buffered,
     MaxBufferPoolSize      = Nequeo.Net.Properties.Settings.Default.MessageClientMaxReceivedMessageSize,
     MaxBufferSize          = (int)Nequeo.Net.Properties.Settings.Default.MessageClientMaxReceivedMessageSize,
     ReaderQuotas           = new System.Xml.XmlDictionaryReaderQuotas()
     {
         MaxArrayLength         = (int)Nequeo.Net.Properties.Settings.Default.MessageClientMaxReceivedMessageSize,
         MaxBytesPerRead        = (int)Nequeo.Net.Properties.Settings.Default.MessageClientMaxReceivedMessageSize,
         MaxDepth               = (int)Nequeo.Net.Properties.Settings.Default.MessageClientMaxReceivedMessageSize,
         MaxNameTableCharCount  = (int)Nequeo.Net.Properties.Settings.Default.MessageClientMaxReceivedMessageSize,
         MaxStringContentLength = (int)Nequeo.Net.Properties.Settings.Default.MessageClientMaxReceivedMessageSize
     }
 }, username, password, usernameWindows, passwordWindows, clientCertificate, validationMode, x509CertificateValidator
         )
 {
     // Start the async control.
     _asyncAccount                = new Nequeo.Threading.AsyncExecutionHandler <MessageClient>();
     _asyncAccount.AsyncError    += new Threading.EventHandler <Exception>(_asyncAccount_AsyncError);
     _asyncAccount.AsyncComplete += new Threading.EventHandler <object, string>(_asyncAccount_AsyncComplete);
     _asyncAccount.InitiliseAsyncInstance(this);
 }
Exemplo n.º 2
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        /// <param name="connection">The web connection adapter used for http connection.</param>
        public TransferWebClient(Nequeo.Net.Http.WebConnectionAdapter connection)
        {
            _connection = connection;

            // Start the async control.
            _asyncAccount                = new Nequeo.Threading.AsyncExecutionHandler <TransferWebClient>();
            _asyncAccount.AsyncError    += new Threading.EventHandler <Exception>(_asyncAccount_AsyncError);
            _asyncAccount.AsyncComplete += new Threading.EventHandler <object, string>(_asyncAccount_AsyncComplete);
            _asyncAccount.InitiliseAsyncInstance(this);
        }
Exemplo n.º 3
0
        /// <summary>
        /// On create instance of User
        /// </summary>
        partial void OnCreated()
        {
            // Start the async control.
            _asyncAccount                = new Nequeo.Threading.AsyncExecutionHandler <User>();
            _asyncAccount.AsyncError    += new Threading.EventHandler <Exception>(_asyncAccount_AsyncError);
            _asyncAccount.AsyncComplete += new Threading.EventHandler <object, string>(_asyncAccount_AsyncComplete);
            _asyncAccount.InitiliseAsyncInstance(this);

            _threadUserContext             = new UserThread(this);
            _threadUserContext.AsyncError += new Threading.EventHandler <Exception>(_asyncAccount_AsyncError);
        }
Exemplo n.º 4
0
 /// <summary>
 /// Basic Http Binding constructor
 /// </summary>
 /// <param name="endPointAddress">The endpoint address to connect to.</param>
 /// <param name="binding">The endpoint binding.</param>
 /// <param name="username">The UserName username</param>
 /// <param name="password">The UserName password</param>
 public MessageClient(string endPointAddress, System.ServiceModel.Channels.Binding binding,
                      string username = null, string password = null) :
     base(
         new Uri(endPointAddress),
         binding, username, password
         )
 {
     // Start the async control.
     _asyncAccount                = new Nequeo.Threading.AsyncExecutionHandler <MessageClient>();
     _asyncAccount.AsyncError    += new Threading.EventHandler <Exception>(_asyncAccount_AsyncError);
     _asyncAccount.AsyncComplete += new Threading.EventHandler <object, string>(_asyncAccount_AsyncComplete);
     _asyncAccount.InitiliseAsyncInstance(this);
 }
Exemplo n.º 5
0
 /// <summary>
 /// Transport security Basic Http binding constructor.
 /// </summary>
 /// <param name="endPointAddress">The endpoint address to connect to.</param>
 /// <param name="username">The UserName username</param>
 /// <param name="password">The UserName password</param>
 public MessageClient(Uri endPointAddress,
                      string username = null, string password = null) :
     base(
         endPointAddress,
         new System.ServiceModel.BasicHttpBinding(System.ServiceModel.BasicHttpSecurityMode.Transport)
 {
     MaxReceivedMessageSize = 167108864,
     MaxBufferSize          = 167108864
 }, username, password
         )
 {
     // Start the async control.
     _asyncAccount                = new Nequeo.Threading.AsyncExecutionHandler <MessageClient>();
     _asyncAccount.AsyncError    += new Threading.EventHandler <Exception>(_asyncAccount_AsyncError);
     _asyncAccount.AsyncComplete += new Threading.EventHandler <object, string>(_asyncAccount_AsyncComplete);
     _asyncAccount.InitiliseAsyncInstance(this);
 }
Exemplo n.º 6
0
 /// <summary>
 /// Default constructor
 /// </summary>
 /// <param name="endPointAddress">The endpoint address to connect to.</param>
 /// <param name="binding">The endpoint binding.</param>
 /// <param name="username">The UserName username</param>
 /// <param name="password">The UserName password</param>
 /// <param name="usernameWindows">The Windows ClientCredential username</param>
 /// <param name="passwordWindows">The Windows ClientCredential password</param>
 /// <param name="clientCertificate">The client x509 certificate.</param>
 /// <param name="validationMode">An enumeration that lists the ways of validating a certificate.</param>
 /// <param name="x509CertificateValidator">The certificate validator. If null then the certificate is always passed.</param>
 public MessageClient(string endPointAddress, System.ServiceModel.Channels.Binding binding,
                      string username                                   = null, string password = null,
                      string usernameWindows                            = null, string passwordWindows = null,
                      X509Certificate2 clientCertificate                = null,
                      X509CertificateValidationMode validationMode      = X509CertificateValidationMode.Custom,
                      X509CertificateValidator x509CertificateValidator = null) :
     base(
         new Uri(endPointAddress),
         binding,
         username, password, usernameWindows, passwordWindows, clientCertificate, validationMode, x509CertificateValidator
         )
 {
     // Start the async control.
     _asyncAccount                = new Nequeo.Threading.AsyncExecutionHandler <MessageClient>();
     _asyncAccount.AsyncError    += new Threading.EventHandler <Exception>(_asyncAccount_AsyncError);
     _asyncAccount.AsyncComplete += new Threading.EventHandler <object, string>(_asyncAccount_AsyncComplete);
     _asyncAccount.InitiliseAsyncInstance(this);
 }