//------------------------------------------------------------------------------
// <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 OrderSubmissionSampleCodeCS.OrderSubmissionWebService {
    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="OrderSubmissionPortTypePortBinding", Namespace="http://medplus.com/orders")]
    [System.Xml.Serialization.XmlIncludeAttribute(typeof(baseHubServiceResponse))]
    public partial class OrderSubmissionService : System.Web.Services.Protocols.SoapHttpClientProtocol {
        
        private System.Threading.SendOrPostCallback submitOrderOperationCompleted;
        
        private System.Threading.SendOrPostCallback getOrderDocumentsOperationCompleted;
        
        private bool useDefaultCredentialsSetExplicitly;
        
        /// <remarks/>
        public OrderSubmissionService() {
            this.Url = global::OrderSubmissionSampleCodeCS.Properties.Settings.Default.OrderSubmissionSampleCodeCS_OrderSubmissionWebService_OrderSubmissionService;
            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 submitOrderCompletedEventHandler submitOrderCompleted;
        
        /// <remarks/>
        public event getOrderDocumentsCompletedEventHandler getOrderDocumentsCompleted;
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace="http://medplus.com/orders", ResponseNamespace="http://medplus.com/orders", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        [return: System.Xml.Serialization.XmlElementAttribute("Result")]
        public orderResponse submitOrder(orderRequest SubmitOrderRequest) {
            object[] results = this.Invoke("submitOrder", new object[] {
                        SubmitOrderRequest});
            return ((orderResponse)(results[0]));
        }
        
        /// <remarks/>
        public void submitOrderAsync(orderRequest SubmitOrderRequest) {
            this.submitOrderAsync(SubmitOrderRequest, null);
        }
        
        /// <remarks/>
        public void submitOrderAsync(orderRequest SubmitOrderRequest, object userState) {
            if ((this.submitOrderOperationCompleted == null)) {
                this.submitOrderOperationCompleted = new System.Threading.SendOrPostCallback(this.OnsubmitOrderOperationCompleted);
            }
            this.InvokeAsync("submitOrder", new object[] {
                        SubmitOrderRequest}, this.submitOrderOperationCompleted, userState);
        }
        
        private void OnsubmitOrderOperationCompleted(object arg) {
            if ((this.submitOrderCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.submitOrderCompleted(this, new submitOrderCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace="http://medplus.com/orders", ResponseNamespace="http://medplus.com/orders", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        [return: System.Xml.Serialization.XmlElementAttribute("Result")]
        public orderSupportServiceResponse getOrderDocuments(orderSupportServiceRequest getOrderDocumentsRequest) {
            object[] results = this.Invoke("getOrderDocuments", new object[] {
                        getOrderDocumentsRequest});
            return ((orderSupportServiceResponse)(results[0]));
        }
        
        /// <remarks/>
        public void getOrderDocumentsAsync(orderSupportServiceRequest getOrderDocumentsRequest) {
            this.getOrderDocumentsAsync(getOrderDocumentsRequest, null);
        }
        
        /// <remarks/>
        public void getOrderDocumentsAsync(orderSupportServiceRequest getOrderDocumentsRequest, object userState) {
            if ((this.getOrderDocumentsOperationCompleted == null)) {
                this.getOrderDocumentsOperationCompleted = new System.Threading.SendOrPostCallback(this.OngetOrderDocumentsOperationCompleted);
            }
            this.InvokeAsync("getOrderDocuments", new object[] {
                        getOrderDocumentsRequest}, this.getOrderDocumentsOperationCompleted, userState);
        }
        
        private void OngetOrderDocumentsOperationCompleted(object arg) {
            if ((this.getOrderDocumentsCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.getOrderDocumentsCompleted(this, new getOrderDocumentsCompletedEventArgs(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.Xml.Serialization.XmlIncludeAttribute(typeof(orderSupportServiceRequest))]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.17929")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://medplus.com/orders")]
    public partial class orderRequest {
        
        private byte[] hl7OrderField;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType="base64Binary")]
        public byte[] hl7Order {
            get {
                return this.hl7OrderField;
            }
            set {
                this.hl7OrderField = value;
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.17929")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://medplus.com/orders")]
    public partial class orderSupportDocument {
        
        private byte[] documentDataField;
        
        private string documentTypeField;
        
        private string requestStatusField;
        
        private string responseMessageField;
        
        private bool successField;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType="base64Binary")]
        public byte[] documentData {
            get {
                return this.documentDataField;
            }
            set {
                this.documentDataField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string documentType {
            get {
                return this.documentTypeField;
            }
            set {
                this.documentTypeField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string requestStatus {
            get {
                return this.requestStatusField;
            }
            set {
                this.requestStatusField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string responseMessage {
            get {
                return this.responseMessageField;
            }
            set {
                this.responseMessageField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public bool success {
            get {
                return this.successField;
            }
            set {
                this.successField = value;
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.17929")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://medplus.com/orders")]
    public partial class responseProperty {
        
        private string propertyNameField;
        
        private string propertyValueField;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string propertyName {
            get {
                return this.propertyNameField;
            }
            set {
                this.propertyNameField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string propertyValue {
            get {
                return this.propertyValueField;
            }
            set {
                this.propertyValueField = value;
            }
        }
    }
    
    /// <remarks/>
    [System.Xml.Serialization.XmlIncludeAttribute(typeof(orderResponse))]
    [System.Xml.Serialization.XmlIncludeAttribute(typeof(orderSupportServiceResponse))]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.17929")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://medplus.com/orders")]
    public partial class baseHubServiceResponse {
        
        private string responseCodeField;
        
        private string responseMsgField;
        
        private responseProperty[] responsePropertiesField;
        
        private string statusField;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string responseCode {
            get {
                return this.responseCodeField;
            }
            set {
                this.responseCodeField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string responseMsg {
            get {
                return this.responseMsgField;
            }
            set {
                this.responseMsgField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute("responseProperties", Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
        public responseProperty[] responseProperties {
            get {
                return this.responsePropertiesField;
            }
            set {
                this.responsePropertiesField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string status {
            get {
                return this.statusField;
            }
            set {
                this.statusField = value;
            }
        }
    }
    
    /// <remarks/>
    [System.Xml.Serialization.XmlIncludeAttribute(typeof(orderSupportServiceResponse))]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.17929")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://medplus.com/orders")]
    public partial class orderResponse : baseHubServiceResponse {
        
        private string messageControlIdField;
        
        private string orderTransactionUidField;
        
        private string[] validationErrorsField;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string messageControlId {
            get {
                return this.messageControlIdField;
            }
            set {
                this.messageControlIdField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string orderTransactionUid {
            get {
                return this.orderTransactionUidField;
            }
            set {
                this.orderTransactionUidField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute("validationErrors", Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
        public string[] validationErrors {
            get {
                return this.validationErrorsField;
            }
            set {
                this.validationErrorsField = value;
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.17929")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://medplus.com/orders")]
    public partial class orderSupportServiceResponse : orderResponse {
        
        private orderSupportDocument[] orderSupportDocumentsField;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute("orderSupportDocuments", Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
        public orderSupportDocument[] orderSupportDocuments {
            get {
                return this.orderSupportDocumentsField;
            }
            set {
                this.orderSupportDocumentsField = value;
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.17929")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://medplus.com/orders")]
    public partial class orderSupportServiceRequest : orderRequest {
        
        private string[] orderSupportRequestsField;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute("orderSupportRequests", Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
        public string[] orderSupportRequests {
            get {
                return this.orderSupportRequestsField;
            }
            set {
                this.orderSupportRequestsField = value;
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.17929")]
    public delegate void submitOrderCompletedEventHandler(object sender, submitOrderCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.17929")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class submitOrderCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal submitOrderCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public orderResponse Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((orderResponse)(this.results[0]));
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.17929")]
    public delegate void getOrderDocumentsCompletedEventHandler(object sender, getOrderDocumentsCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.17929")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class getOrderDocumentsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal getOrderDocumentsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public orderSupportServiceResponse Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((orderSupportServiceResponse)(this.results[0]));
            }
        }
    }
}

#pragma warning restore 1591