'------------------------------------------------------------------------------
' <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 OrderWebService
    
    '''<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(GetType(ResponseProperty)),  _
     System.Xml.Serialization.SoapIncludeAttribute(GetType(BaseHubServiceResponse))>  _
    Partial Public Class OrderService
        Inherits System.Web.Services.Protocols.SoapHttpClientProtocol
        
        Private submitOrderOperationCompleted As System.Threading.SendOrPostCallback
        
        Private validateOrderOperationCompleted As System.Threading.SendOrPostCallback
        
        Private useDefaultCredentialsSetExplicitly As Boolean
        
        '''<remarks/>
        Public Sub New()
            MyBase.New
            Me.Url = "https://cert.hub.care360.com:443/orders/service"
            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 validateOrderCompleted As validateOrderCompletedEventHandler
        
        '''<remarks/>
        <System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace:="http://medplus.com/orders", ResponseNamespace:="http://medplus.com/orders")>  _
        Public Function submitOrder(ByVal order As Order) As <System.Xml.Serialization.SoapElementAttribute("result")> OrderResponse
            Dim results() As Object = Me.Invoke("submitOrder", New Object() {order})
            Return CType(results(0),OrderResponse)
        End Function
        
        '''<remarks/>
        Public Function BeginsubmitOrder(ByVal order As Order, ByVal callback As System.AsyncCallback, ByVal asyncState As Object) As System.IAsyncResult
            Return Me.BeginInvoke("submitOrder", New Object() {order}, callback, asyncState)
        End Function
        
        '''<remarks/>
        Public Function EndsubmitOrder(ByVal asyncResult As System.IAsyncResult) As OrderResponse
            Dim results() As Object = Me.EndInvoke(asyncResult)
            Return CType(results(0),OrderResponse)
        End Function
        
        '''<remarks/>
        Public Overloads Sub submitOrderAsync(ByVal order As Order)
            Me.submitOrderAsync(order, Nothing)
        End Sub
        
        '''<remarks/>
        Public Overloads Sub submitOrderAsync(ByVal order As Order, ByVal userState As Object)
            If (Me.submitOrderOperationCompleted Is Nothing) Then
                Me.submitOrderOperationCompleted = AddressOf Me.OnsubmitOrderOperationCompleted
            End If
            Me.InvokeAsync("submitOrder", New Object() {order}, 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.SoapRpcMethodAttribute("", RequestNamespace:="http://medplus.com/orders", ResponseNamespace:="http://medplus.com/orders")>  _
        Public Function validateOrder(ByVal order As Order) As <System.Xml.Serialization.SoapElementAttribute("result")> OrderResponse
            Dim results() As Object = Me.Invoke("validateOrder", New Object() {order})
            Return CType(results(0),OrderResponse)
        End Function
        
        '''<remarks/>
        Public Function BeginvalidateOrder(ByVal order As Order, ByVal callback As System.AsyncCallback, ByVal asyncState As Object) As System.IAsyncResult
            Return Me.BeginInvoke("validateOrder", New Object() {order}, callback, asyncState)
        End Function
        
        '''<remarks/>
        Public Function EndvalidateOrder(ByVal asyncResult As System.IAsyncResult) As OrderResponse
            Dim results() As Object = Me.EndInvoke(asyncResult)
            Return CType(results(0),OrderResponse)
        End Function
        
        '''<remarks/>
        Public Overloads Sub validateOrderAsync(ByVal order As Order)
            Me.validateOrderAsync(order, Nothing)
        End Sub
        
        '''<remarks/>
        Public Overloads Sub validateOrderAsync(ByVal order As Order, ByVal userState As Object)
            If (Me.validateOrderOperationCompleted Is Nothing) Then
                Me.validateOrderOperationCompleted = AddressOf Me.OnvalidateOrderOperationCompleted
            End If
            Me.InvokeAsync("validateOrder", New Object() {order}, Me.validateOrderOperationCompleted, userState)
        End Sub
        
        Private Sub OnvalidateOrderOperationCompleted(ByVal arg As Object)
            If (Not (Me.validateOrderCompletedEvent) Is Nothing) Then
                Dim invokeArgs As System.Web.Services.Protocols.InvokeCompletedEventArgs = CType(arg,System.Web.Services.Protocols.InvokeCompletedEventArgs)
                RaiseEvent validateOrderCompleted(Me, New validateOrderCompletedEventArgs(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.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")>  _
    Partial Public Class Order
        
        Private hl7OrderField() As Byte
        
        '''<remarks/>
        <System.Xml.Serialization.SoapElementAttribute(DataType:="base64Binary", IsNullable:=true)>  _
        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.SoapTypeAttribute([Namespace]:="java:com.medplus.serviceHub.framework.webservices")>  _
    Partial Public Class ResponseProperty
        
        Private propertyNameField As String
        
        Private propertyValueField As String
        
        '''<remarks/>
        <System.Xml.Serialization.SoapElementAttribute(IsNullable:=true)>  _
        Public Property propertyName() As String
            Get
                Return Me.propertyNameField
            End Get
            Set
                Me.propertyNameField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.SoapElementAttribute(IsNullable:=true)>  _
        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.SoapIncludeAttribute(GetType(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")>  _
    Partial Public Class BaseHubServiceResponse
        
        Private responseCodeField As String
        
        Private responseMsgField As String
        
        Private responsePropertiesField() As ResponseProperty
        
        Private statusField As String
        
        '''<remarks/>
        <System.Xml.Serialization.SoapElementAttribute(IsNullable:=true)>  _
        Public Property responseCode() As String
            Get
                Return Me.responseCodeField
            End Get
            Set
                Me.responseCodeField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.SoapElementAttribute(IsNullable:=true)>  _
        Public Property responseMsg() As String
            Get
                Return Me.responseMsgField
            End Get
            Set
                Me.responseMsgField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.SoapElementAttribute(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.SoapElementAttribute(IsNullable:=true)>  _
        Public Property status() As String
            Get
                Return Me.statusField
            End Get
            Set
                Me.statusField = 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.SoapTypeAttribute([Namespace]:="java:com.medplus.serviceHub.orders.webservice")>  _
    Partial Public Class OrderResponse
        Inherits BaseHubServiceResponse
        
        Private messageControlIdField As String
        
        Private orderTransactionUidField As String
        
        Private validationErrorsField() As String
        
        '''<remarks/>
        <System.Xml.Serialization.SoapElementAttribute(IsNullable:=true)>  _
        Public Property messageControlId() As String
            Get
                Return Me.messageControlIdField
            End Get
            Set
                Me.messageControlIdField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.SoapElementAttribute(IsNullable:=true)>  _
        Public Property orderTransactionUid() As String
            Get
                Return Me.orderTransactionUidField
            End Get
            Set
                Me.orderTransactionUidField = value
            End Set
        End Property
        
        '''<remarks/>
        <System.Xml.Serialization.SoapElementAttribute(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.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 validateOrderCompletedEventHandler(ByVal sender As Object, ByVal e As validateOrderCompletedEventArgs)
    
    '''<remarks/>
    <System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.17929"),  _
     System.Diagnostics.DebuggerStepThroughAttribute(),  _
     System.ComponentModel.DesignerCategoryAttribute("code")>  _
    Partial Public Class validateOrderCompletedEventArgs
        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
End Namespace
