Пример #1
0
        /// <summary>
        /// Every conversation turn for our Echo Bot will call this method.
        /// There are no dialogs used, since it's "single turn" processing, meaning a single
        /// request and response.
        /// </summary>
        /// <param name="turnContext">A <see cref="ITurnContext"/> containing all the data needed
        /// for processing this conversation turn. </param>
        /// <param name="cancellationToken">(Optional) A <see cref="CancellationToken"/> that can be used by other objects
        /// or threads to receive notice of cancellation.</param>
        /// <returns>A <see cref="Task"/> that represents the work queued to execute.</returns>
        /// <seealso cref="BotStateSet"/>
        /// <seealso cref="ConversationState"/>
        /// <seealso cref="IMiddleware"/>
        public async void CreateReq(Activity activity)
        {
            ACADBot_PortClient portClient = new ACADBot_PortClient();

            var binding = new BasicHttpBinding(BasicHttpSecurityMode.Transport);

            binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows;
            binding.SendTimeout            = new TimeSpan(0, 0, 3);
            binding.MaxBufferSize          = int.MaxValue;
            binding.MaxReceivedMessageSize = int.MaxValue;

            portClient.Endpoint.Binding = binding;

            var credentials = new NetworkCredential("student05", "Qwerty05");

            portClient.ClientCredentials.Windows.ClientCredential          = credentials;
            portClient.ClientCredentials.Windows.AllowedImpersonationLevel = TokenImpersonationLevel.Delegation;


            portClient.ClientCredentials.ServiceCertificate.SslCertificateAuthentication =
                new X509ServiceCertificateAuthentication()
            {
                CertificateValidationMode = X509CertificateValidationMode.None,
                RevocationMode            = System.Security.Cryptography.X509Certificates.X509RevocationMode.NoCheck
            };

            var result = await portClient.CreateNewRequestAsync(new CreateNewRequest( new OutofOfficeRequest
            {
                EntryNo = "REQ10000",
                EmployeeNo = "LM",
                StartDate = new DateTime(2020, 10, 20),
                StartTime = new DateTime(2020, 1, 1, 10, 0, 0),
                EndDate = new DateTime(2020, 10, 21),
                EndTime = new DateTime(2020, 10, 21, 18, 0, 0),
                ReasonCode = "SICK",
                Status = "New",
                Description = activity.Text
            }, new Result()));
        }
Пример #2
0
 private static System.ServiceModel.EndpointAddress GetDefaultEndpointAddress()
 {
     return(ACADBot_PortClient.GetEndpointAddress(EndpointConfiguration.ACADBot_Port));
 }
Пример #3
0
 private static System.ServiceModel.Channels.Binding GetDefaultBinding()
 {
     return(ACADBot_PortClient.GetBindingForEndpoint(EndpointConfiguration.ACADBot_Port));
 }
Пример #4
0
 public ACADBot_PortClient(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) :
     base(ACADBot_PortClient.GetBindingForEndpoint(endpointConfiguration), remoteAddress)
 {
     this.Endpoint.Name = endpointConfiguration.ToString();
     ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
 }
Пример #5
0
 public ACADBot_PortClient(EndpointConfiguration endpointConfiguration) :
     base(ACADBot_PortClient.GetBindingForEndpoint(endpointConfiguration), ACADBot_PortClient.GetEndpointAddress(endpointConfiguration))
 {
     this.Endpoint.Name = endpointConfiguration.ToString();
     ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
 }
Пример #6
0
 public ACADBot_PortClient() :
     base(ACADBot_PortClient.GetDefaultBinding(), ACADBot_PortClient.GetDefaultEndpointAddress())
 {
     this.Endpoint.Name = EndpointConfiguration.ACADBot_Port.ToString();
     ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
 }