//------------------------------------------------------------------------------
// <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 OrdersSampleCodeCS.OrderWebService {
    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="OrderServicePort", Namespace="http://medplus.com/orders")]
    [System.Xml.Serialization.SoapIncludeAttribute(typeof(ResponseProperty))]
    [System.Xml.Serialization.SoapIncludeAttribute(typeof(BaseHubServiceResponse))]
    public partial class OrderService : System.Web.Services.Protocols.SoapHttpClientProtocol {
        
        private System.Threading.SendOrPostCallback submitOrderOperationCompleted;
        
        private System.Threading.SendOrPostCallback validateOrderOperationCompleted;
        
        private bool useDefaultCredentialsSetExplicitly;
        
        /// <remarks/>
        public OrderService() {
            this.Url = "https://shubservices.questemr.com:443/orders/service";
            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 validateOrderCompletedEventHandler validateOrderCompleted;
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://medplus.com/orders", ResponseNamespace="http://medplus.com/orders")]
        [return: System.Xml.Serialization.SoapElementAttribute("result")]
        public OrderResponse submitOrder(Order order) {
            object[] results = this.Invoke("submitOrder", new object[] {
                        order});
            return ((OrderResponse)(results[0]));
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginsubmitOrder(Order order, System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("submitOrder", new object[] {
                        order}, callback, asyncState);
        }
        
        /// <remarks/>
        public OrderResponse EndsubmitOrder(System.IAsyncResult asyncResult) {
            object[] results = this.EndInvoke(asyncResult);
            return ((OrderResponse)(results[0]));
        }
        
        /// <remarks/>
        public void submitOrderAsync(Order order) {
            this.submitOrderAsync(order, null);
        }
        
        /// <remarks/>
        public void submitOrderAsync(Order order, object userState) {
            if ((this.submitOrderOperationCompleted == null)) {
                this.submitOrderOperationCompleted = new System.Threading.SendOrPostCallback(this.OnsubmitOrderOperationCompleted);
            }
            this.InvokeAsync("submitOrder", new object[] {
                        order}, 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.SoapRpcMethodAttribute("", RequestNamespace="http://medplus.com/orders", ResponseNamespace="http://medplus.com/orders")]
        [return: System.Xml.Serialization.SoapElementAttribute("result")]
        public OrderResponse validateOrder(Order order) {
            object[] results = this.Invoke("validateOrder", new object[] {
                        order});
            return ((OrderResponse)(results[0]));
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginvalidateOrder(Order order, System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("validateOrder", new object[] {
                        order}, callback, asyncState);
        }
        
        /// <remarks/>
        public OrderResponse EndvalidateOrder(System.IAsyncResult asyncResult) {
            object[] results = this.EndInvoke(asyncResult);
            return ((OrderResponse)(results[0]));
        }
        
        /// <remarks/>
        public void validateOrderAsync(Order order) {
            this.validateOrderAsync(order, null);
        }
        
        /// <remarks/>
        public void validateOrderAsync(Order order, object userState) {
            if ((this.validateOrderOperationCompleted == null)) {
                this.validateOrderOperationCompleted = new System.Threading.SendOrPostCallback(this.OnvalidateOrderOperationCompleted);
            }
            this.InvokeAsync("validateOrder", new object[] {
                        order}, this.validateOrderOperationCompleted, userState);
        }
        
        private void OnvalidateOrderOperationCompleted(object arg) {
            if ((this.validateOrderCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.validateOrderCompleted(this, new validateOrderCompletedEventArgs(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.orders.webservice")]
    public partial class Order {
        
        private byte[] hl7OrderField;
        
        /// <remarks/>
        [System.Xml.Serialization.SoapElementAttribute(DataType="base64Binary", IsNullable=true)]
        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.SoapTypeAttribute(Namespace="java:com.medplus.serviceHub.framework.webservices")]
    public partial class ResponseProperty {
        
        private string propertyNameField;
        
        private string propertyValueField;
        
        /// <remarks/>
        [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
        public string propertyName {
            get {
                return this.propertyNameField;
            }
            set {
                this.propertyNameField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
        public string propertyValue {
            get {
                return this.propertyValueField;
            }
            set {
                this.propertyValueField = value;
            }
        }
    }
    
    /// <remarks/>
    [System.Xml.Serialization.SoapIncludeAttribute(typeof(OrderResponse))]
    [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.framework.webservices")]
    public partial class BaseHubServiceResponse {
        
        private string responseCodeField;
        
        private string responseMsgField;
        
        private ResponseProperty[] responsePropertiesField;
        
        private string statusField;
        
        /// <remarks/>
        [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
        public string responseCode {
            get {
                return this.responseCodeField;
            }
            set {
                this.responseCodeField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
        public string responseMsg {
            get {
                return this.responseMsgField;
            }
            set {
                this.responseMsgField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
        public ResponseProperty[] responseProperties {
            get {
                return this.responsePropertiesField;
            }
            set {
                this.responsePropertiesField = 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.Xml", "4.0.30319.17929")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.SoapTypeAttribute(Namespace="java:com.medplus.serviceHub.orders.webservice")]
    public partial class OrderResponse : BaseHubServiceResponse {
        
        private string messageControlIdField;
        
        private string orderTransactionUidField;
        
        private string[] validationErrorsField;
        
        /// <remarks/>
        [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
        public string messageControlId {
            get {
                return this.messageControlIdField;
            }
            set {
                this.messageControlIdField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
        public string orderTransactionUid {
            get {
                return this.orderTransactionUidField;
            }
            set {
                this.orderTransactionUidField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
        public string[] validationErrors {
            get {
                return this.validationErrorsField;
            }
            set {
                this.validationErrorsField = 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 validateOrderCompletedEventHandler(object sender, validateOrderCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.17929")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class validateOrderCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal validateOrderCompletedEventArgs(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]));
            }
        }
    }
}

#pragma warning restore 1591