//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.17929
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

// 
// This source code was auto-generated by Microsoft.VSDesigner, Version 4.0.30319.17929.
// 
#pragma warning disable 1591

namespace PatientDemographicsSampleCodeCS.PatientDemographicsWebService {
    using System;
    using System.Web.Services;
    using System.Diagnostics;
    using System.Web.Services.Protocols;
    using System.Xml.Serialization;
    using System.ComponentModel;
    
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.17929")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Web.Services.WebServiceBindingAttribute(Name="DemographicServicePort", Namespace="http://medplus.com/demographic")]
    public partial class DemographicService : System.Web.Services.Protocols.SoapHttpClientProtocol {
        
        private System.Threading.SendOrPostCallback submitRealTimeADTMessageOperationCompleted;
        
        private System.Threading.SendOrPostCallback submitBatchADTMessageOperationCompleted;
        
        private bool useDefaultCredentialsSetExplicitly;
        
        /// <remarks/>
        public DemographicService() {
            this.Url = global::PatientDemographicsSampleCodeCS.Properties.Settings.Default.PatientDemographicsSampleCodeCS_PatientDemographicsWebService_DemographicService;
            if ((this.IsLocalFileSystemWebService(this.Url) == true)) {
                this.UseDefaultCredentials = true;
                this.useDefaultCredentialsSetExplicitly = false;
            }
            else {
                this.useDefaultCredentialsSetExplicitly = true;
            }
        }
        
        public new string Url {
            get {
                return base.Url;
            }
            set {
                if ((((this.IsLocalFileSystemWebService(base.Url) == true) 
                            && (this.useDefaultCredentialsSetExplicitly == false)) 
                            && (this.IsLocalFileSystemWebService(value) == false))) {
                    base.UseDefaultCredentials = false;
                }
                base.Url = value;
            }
        }
        
        public new bool UseDefaultCredentials {
            get {
                return base.UseDefaultCredentials;
            }
            set {
                base.UseDefaultCredentials = value;
                this.useDefaultCredentialsSetExplicitly = true;
            }
        }
        
        /// <remarks/>
        public event submitRealTimeADTMessageCompletedEventHandler submitRealTimeADTMessageCompleted;
        
        /// <remarks/>
        public event submitBatchADTMessageCompletedEventHandler submitBatchADTMessageCompleted;
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://medplus.com/demographic", ResponseNamespace="http://medplus.com/demographic")]
        [return: System.Xml.Serialization.SoapElementAttribute("result")]
        public DemographicResponse submitRealTimeADTMessage(DemographicRequest request) {
            object[] results = this.Invoke("submitRealTimeADTMessage", new object[] {
                        request});
            return ((DemographicResponse)(results[0]));
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginsubmitRealTimeADTMessage(DemographicRequest request, System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("submitRealTimeADTMessage", new object[] {
                        request}, callback, asyncState);
        }
        
        /// <remarks/>
        public DemographicResponse EndsubmitRealTimeADTMessage(System.IAsyncResult asyncResult) {
            object[] results = this.EndInvoke(asyncResult);
            return ((DemographicResponse)(results[0]));
        }
        
        /// <remarks/>
        public void submitRealTimeADTMessageAsync(DemographicRequest request) {
            this.submitRealTimeADTMessageAsync(request, null);
        }
        
        /// <remarks/>
        public void submitRealTimeADTMessageAsync(DemographicRequest request, object userState) {
            if ((this.submitRealTimeADTMessageOperationCompleted == null)) {
                this.submitRealTimeADTMessageOperationCompleted = new System.Threading.SendOrPostCallback(this.OnsubmitRealTimeADTMessageOperationCompleted);
            }
            this.InvokeAsync("submitRealTimeADTMessage", new object[] {
                        request}, this.submitRealTimeADTMessageOperationCompleted, userState);
        }
        
        private void OnsubmitRealTimeADTMessageOperationCompleted(object arg) {
            if ((this.submitRealTimeADTMessageCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.submitRealTimeADTMessageCompleted(this, new submitRealTimeADTMessageCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://medplus.com/demographic", ResponseNamespace="http://medplus.com/demographic")]
        [return: System.Xml.Serialization.SoapElementAttribute("result")]
        public DemographicResponse submitBatchADTMessage(DemographicRequest request) {
            object[] results = this.Invoke("submitBatchADTMessage", new object[] {
                        request});
            return ((DemographicResponse)(results[0]));
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginsubmitBatchADTMessage(DemographicRequest request, System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("submitBatchADTMessage", new object[] {
                        request}, callback, asyncState);
        }
        
        /// <remarks/>
        public DemographicResponse EndsubmitBatchADTMessage(System.IAsyncResult asyncResult) {
            object[] results = this.EndInvoke(asyncResult);
            return ((DemographicResponse)(results[0]));
        }
        
        /// <remarks/>
        public void submitBatchADTMessageAsync(DemographicRequest request) {
            this.submitBatchADTMessageAsync(request, null);
        }
        
        /// <remarks/>
        public void submitBatchADTMessageAsync(DemographicRequest request, object userState) {
            if ((this.submitBatchADTMessageOperationCompleted == null)) {
                this.submitBatchADTMessageOperationCompleted = new System.Threading.SendOrPostCallback(this.OnsubmitBatchADTMessageOperationCompleted);
            }
            this.InvokeAsync("submitBatchADTMessage", new object[] {
                        request}, this.submitBatchADTMessageOperationCompleted, userState);
        }
        
        private void OnsubmitBatchADTMessageOperationCompleted(object arg) {
            if ((this.submitBatchADTMessageCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.submitBatchADTMessageCompleted(this, new submitBatchADTMessageCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        public new void CancelAsync(object userState) {
            base.CancelAsync(userState);
        }
        
        private bool IsLocalFileSystemWebService(string url) {
            if (((url == null) 
                        || (url == string.Empty))) {
                return false;
            }
            System.Uri wsUri = new System.Uri(url);
            if (((wsUri.Port >= 1024) 
                        && (string.Compare(wsUri.Host, "localHost", System.StringComparison.OrdinalIgnoreCase) == 0))) {
                return true;
            }
            return false;
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.17929")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.SoapTypeAttribute(Namespace="java:com.medplus.serviceHub.mpi.webservice")]
    public partial class DemographicRequest {
        
        private byte[] aDTMessageField;
        
        /// <remarks/>
        [System.Xml.Serialization.SoapElementAttribute(DataType="base64Binary", IsNullable=true)]
        public byte[] ADTMessage {
            get {
                return this.aDTMessageField;
            }
            set {
                this.aDTMessageField = value;
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.17929")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.SoapTypeAttribute(Namespace="java:com.medplus.serviceHub.mpi.webservice")]
    public partial class DemographicResponse {
        
        private string[] errorsField;
        
        private string hubTransactionUidField;
        
        private string messageControlUidField;
        
        private string statusField;
        
        /// <remarks/>
        [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
        public string[] errors {
            get {
                return this.errorsField;
            }
            set {
                this.errorsField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
        public string hubTransactionUid {
            get {
                return this.hubTransactionUidField;
            }
            set {
                this.hubTransactionUidField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
        public string messageControlUid {
            get {
                return this.messageControlUidField;
            }
            set {
                this.messageControlUidField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
        public string status {
            get {
                return this.statusField;
            }
            set {
                this.statusField = value;
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.17929")]
    public delegate void submitRealTimeADTMessageCompletedEventHandler(object sender, submitRealTimeADTMessageCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.17929")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class submitRealTimeADTMessageCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal submitRealTimeADTMessageCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public DemographicResponse Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((DemographicResponse)(this.results[0]));
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.17929")]
    public delegate void submitBatchADTMessageCompletedEventHandler(object sender, submitBatchADTMessageCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.17929")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class submitBatchADTMessageCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal submitBatchADTMessageCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public DemographicResponse Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((DemographicResponse)(this.results[0]));
            }
        }
    }
}

#pragma warning restore 1591