'------------------------------------------------------------------------------
' <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>
'------------------------------------------------------------------------------

Option Strict Off
Option Explicit On

Imports System
Imports System.ComponentModel
Imports System.Diagnostics
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.Xml.Serialization

'
'This source code was auto-generated by Microsoft.VSDesigner, Version 4.0.30319.17929.
'
Namespace OrderSubmissionWebService
    
    '''<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(GetType(baseHubServiceResponse))>  _
    Partial Public Class OrderSubmissionService
        Inherits System.Web.Services.Protocols.SoapHttpClientProtocol
        
        Private submitOrderOperationCompleted As System.Threading.SendOrPostCallback
        
        Private getOrderDocumentsOperationCompleted As System.Threading.SendOrPostCallback
        
        Private useDefaultCredentialsSetExplicitly As Boolean
        
        '''<remarks/>
        Public Sub New()
            MyBase.New
            Me.Url = Global.OrderSubmissionSampleCode.My.MySettings.Default.OrderSubmissionSampleCode_OrderSubmissionWebService_OrderSubmissionService
            If (Me.IsLocalFileSystemWebService(Me.Url) = true) Then
                Me.UseDefaultCredentials = true
                Me.useDefaultCredentialsSetExplicitly = false
            Else
                Me.useDefaultCredentialsSetExplicitly = true
            End If
        End Sub
        
        Public Shadows Property Url() As String
            Get
                Return MyBase.Url
            End Get
            Set
                If (((Me.IsLocalFileSystemWebService(MyBase.Url) = true)  _
                            AndAlso (Me.useDefaultCredentialsSetExplicitly = false))  _
                            AndAlso (Me.IsLocalFileSystemWebService(value) = false)) Then
                    MyBase.UseDefaultCredentials = false
                End If
                MyBase.Url = value
            End Set
        End Property
        
        Public Shadows Property UseDefaultCredentials() As Boolean
            Get
                Return MyBase.UseDefaultCredentials
            End Get
            Set
                MyBase.UseDefaultCredentials = value
                Me.useDefaultCredentialsSetExplicitly = true
            End Set
        End Property
        
        '''<remarks/>
        Public Event submitOrderCompleted As submitOrderCompletedEventHandler
        
        '''<remarks/>
        Public Event getOrderDocumentsCompleted As getOrderDocumentsCompletedEventHandler
        
        '''<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)>  _
        Public Function submitOrder(ByVal SubmitOrderRequest As orderRequest) As <System.Xml.Serialization.XmlElementAttribute("Result")> orderResponse
            Dim results() As Object = Me.Invoke("submitOrder", New Object() {SubmitOrderRequest})
            Return CType(results(0),orderResponse)
        End Function
        
        '''<remarks/>
        Public Overloads Sub submitOrderAsync(ByVal SubmitOrderRequest As orderRequest)
            Me.submitOrderAsync(SubmitOrderRequest, Nothing)
        End Sub
        
        '''<remarks/>
        Public Overloads Sub submitOrderAsync(ByVal SubmitOrderRequest As orderRequest, ByVal userState As Object)
            If (Me.submitOrderOperationCompleted Is Nothing) Then
                Me.submitOrderOperationCompleted = AddressOf Me.OnsubmitOrderOperationCompleted
            End If
            Me.InvokeAsync("submitOrder", New Object() {SubmitOrderRequest}, Me.submitOrderOperationCompleted, userState)
        End Sub
        
        Private Sub OnsubmitOrderOperationCompleted(ByVal arg As Object)
            If (Not (Me.submitOrderCompletedEvent) Is Nothing) Then
                Dim invokeArgs As System.Web.Services.Protocols.InvokeCompletedEventArgs = CType(arg,System.Web.Services.Protocols.InvokeCompletedEventArgs)
                RaiseEvent submitOrderCompleted(Me, New submitOrderCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState))
            End If
        End Sub
        
        '''<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)>  _
        Public Function getOrderDocuments(ByVal getOrderDocumentsRequest As orderSupportServiceRequest) As <System.Xml.Serialization.XmlElementAttribute("Result")> orderSupportServiceResponse
            Dim results() As Object = Me.Invoke("getOrderDocuments", New Object() {getOrderDocumentsRequest})
            Return CType(results(0),orderSupportServiceResponse)
        End Function
        
        '''<remarks/>
        Public Overloads Sub getOrderDocumentsAsync(ByVal getOrderDocumentsRequest As orderSupportServiceRequest)
            Me.getOrderDocumentsAsync(getOrderDocumentsRequest, Nothing)
        End Sub
        
        '''<remarks/>
        Public Overloads Sub getOrderDocumentsAsync(ByVal getOrderDocumentsRequest As orderSupportServiceRequest, ByVal userState As Object)
            If (Me.getOrderDocumentsOperationCompleted Is Nothing) Then
                Me.getOrderDocumentsOperationCompleted = AddressOf Me.OngetOrderDocumentsOperationCompleted
            End If
            Me.InvokeAsync("getOrderDocuments", New Object() {getOrderDocumentsRequest}, Me.getOrderDocumentsOperationCompleted, userState)
        End Sub
        
        Private Sub OngetOrderDocumentsOperationCompleted(ByVal arg As Object)
            If (Not (Me.getOrderDocumentsCompletedEvent) Is Nothing) Then
                Dim invokeArgs As System.Web.Services.Protocols.InvokeCompletedEventArgs = CType(arg,System.Web.Services.Protocols.InvokeCompletedEventArgs)
                RaiseEvent getOrderDocumentsCompleted(Me, New getOrderDocumentsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState))
            End If
        End Sub
        
        '''<remarks/>
        Public Shadows Sub CancelAsync(ByVal userState As Object)
            MyBase.CancelAsync(userState)
        End Sub
        
        Private Function IsLocalFileSystemWebService(ByVal url As String) As Boolean
            If ((url Is Nothing)  _
                        OrElse (url Is String.Empty)) Then
                Return false
            End If
            Dim wsUri As System.Uri = New System.Uri(url)
            If ((wsUri.Port >= 1024)  _
                        AndAlso (String.Compare(wsUri.Host, "localHost", System.StringComparison.OrdinalIgnoreCase) = 0)) Then
                Return true
            End If
            Return false
        End Function
    End Class
    
    '''<remarks/>
    <System.Xml.Serialization.XmlIncludeAttribute(GetType(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")>  _
    Partial Public Class orderRequest
        
        Private hl7OrderField() As Byte
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="base64Binary")>  _
        Public Property hl7Order() As Byte()
            Get
                Return Me.hl7OrderField
            End Get
            Set
                Me.hl7OrderField = value
            End Set
        End Property
    End Class
    
    '''<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")>  _
    Partial Public Class orderSupportDocument
        
        Private documentDataField() As Byte
        
        Private documentTypeField As String
        
        Private requestStatusField As String
        
        Private responseMessageField As String
        
        Private successField As Boolean
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="base64Binary")>  _
        Public Property documentData() As Byte()
            Get
                Return Me.documentDataField
            End Get
            Set
                Me.documentDataField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property documentType() As String
            Get
                Return Me.documentTypeField
            End Get
            Set
                Me.documentTypeField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property requestStatus() As String
            Get
                Return Me.requestStatusField
            End Get
            Set
                Me.requestStatusField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property responseMessage() As String
            Get
                Return Me.responseMessageField
            End Get
            Set
                Me.responseMessageField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property success() As Boolean
            Get
                Return Me.successField
            End Get
            Set
                Me.successField = value
            End Set
        End Property
    End Class
    
    '''<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")>  _
    Partial Public Class responseProperty
        
        Private propertyNameField As String
        
        Private propertyValueField As String
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property propertyName() As String
            Get
                Return Me.propertyNameField
            End Get
            Set
                Me.propertyNameField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property propertyValue() As String
            Get
                Return Me.propertyValueField
            End Get
            Set
                Me.propertyValueField = value
            End Set
        End Property
    End Class
    
    '''<remarks/>
    <System.Xml.Serialization.XmlIncludeAttribute(GetType(orderResponse)),  _
     System.Xml.Serialization.XmlIncludeAttribute(GetType(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")>  _
    Partial Public Class baseHubServiceResponse
        
        Private responseCodeField As String
        
        Private responseMsgField As String
        
        Private responsePropertiesField() As responseProperty
        
        Private statusField As String
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property responseCode() As String
            Get
                Return Me.responseCodeField
            End Get
            Set
                Me.responseCodeField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property responseMsg() As String
            Get
                Return Me.responseMsgField
            End Get
            Set
                Me.responseMsgField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute("responseProperties", Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable:=true)>  _
        Public Property responseProperties() As responseProperty()
            Get
                Return Me.responsePropertiesField
            End Get
            Set
                Me.responsePropertiesField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property status() As String
            Get
                Return Me.statusField
            End Get
            Set
                Me.statusField = value
            End Set
        End Property
    End Class
    
    '''<remarks/>
    <System.Xml.Serialization.XmlIncludeAttribute(GetType(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")>  _
    Partial Public Class orderResponse
        Inherits baseHubServiceResponse
        
        Private messageControlIdField As String
        
        Private orderTransactionUidField As String
        
        Private validationErrorsField() As String
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property messageControlId() As String
            Get
                Return Me.messageControlIdField
            End Get
            Set
                Me.messageControlIdField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
        Public Property orderTransactionUid() As String
            Get
                Return Me.orderTransactionUidField
            End Get
            Set
                Me.orderTransactionUidField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute("validationErrors", Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable:=true)>  _
        Public Property validationErrors() As String()
            Get
                Return Me.validationErrorsField
            End Get
            Set
                Me.validationErrorsField = value
            End Set
        End Property
    End Class
    
    '''<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")>  _
    Partial Public Class orderSupportServiceResponse
        Inherits orderResponse
        
        Private orderSupportDocumentsField() As orderSupportDocument
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute("orderSupportDocuments", Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable:=true)>  _
        Public Property orderSupportDocuments() As orderSupportDocument()
            Get
                Return Me.orderSupportDocumentsField
            End Get
            Set
                Me.orderSupportDocumentsField = value
            End Set
        End Property
    End Class
    
    '''<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")>  _
    Partial Public Class orderSupportServiceRequest
        Inherits orderRequest
        
        Private orderSupportRequestsField() As String
        
        '''<remarks/>
        <System.Xml.Serialization.XmlElementAttribute("orderSupportRequests", Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable:=true)>  _
        Public Property orderSupportRequests() As String()
            Get
                Return Me.orderSupportRequestsField
            End Get
            Set
                Me.orderSupportRequestsField = value
            End Set
        End Property
    End Class
    
    '''<remarks/>
    <System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.17929")>  _
    Public Delegate Sub submitOrderCompletedEventHandler(ByVal sender As Object, ByVal e As submitOrderCompletedEventArgs)
    
    '''<remarks/>
    <System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.17929"),  _
     System.Diagnostics.DebuggerStepThroughAttribute(),  _
     System.ComponentModel.DesignerCategoryAttribute("code")>  _
    Partial Public Class submitOrderCompletedEventArgs
        Inherits System.ComponentModel.AsyncCompletedEventArgs
        
        Private results() As Object
        
        Friend Sub New(ByVal results() As Object, ByVal exception As System.Exception, ByVal cancelled As Boolean, ByVal userState As Object)
            MyBase.New(exception, cancelled, userState)
            Me.results = results
        End Sub
        
        '''<remarks/>
        Public ReadOnly Property Result() As orderResponse
            Get
                Me.RaiseExceptionIfNecessary
                Return CType(Me.results(0),orderResponse)
            End Get
        End Property
    End Class
    
    '''<remarks/>
    <System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.17929")>  _
    Public Delegate Sub getOrderDocumentsCompletedEventHandler(ByVal sender As Object, ByVal e As getOrderDocumentsCompletedEventArgs)
    
    '''<remarks/>
    <System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.17929"),  _
     System.Diagnostics.DebuggerStepThroughAttribute(),  _
     System.ComponentModel.DesignerCategoryAttribute("code")>  _
    Partial Public Class getOrderDocumentsCompletedEventArgs
        Inherits System.ComponentModel.AsyncCompletedEventArgs
        
        Private results() As Object
        
        Friend Sub New(ByVal results() As Object, ByVal exception As System.Exception, ByVal cancelled As Boolean, ByVal userState As Object)
            MyBase.New(exception, cancelled, userState)
            Me.results = results
        End Sub
        
        '''<remarks/>
        Public ReadOnly Property Result() As orderSupportServiceResponse
            Get
                Me.RaiseExceptionIfNecessary
                Return CType(Me.results(0),orderSupportServiceResponse)
            End Get
        End Property
    End Class
End Namespace
