'------------------------------------------------------------------------------
' <auto-generated>
'     Dieser Code wurde von einem Tool generiert.
'     Laufzeitversion:4.0.30319.42000
'
'     Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
'     der Code erneut generiert wird.
' </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

'
'Der Quellcode wurde automatisch mit Microsoft.VSDesigner generiert. Version 4.0.30319.42000.
'
Namespace eu.europa.ec
    
    '''<remarks/>
    <System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.9037.0"),  _
     System.Diagnostics.DebuggerStepThroughAttribute(),  _
     System.ComponentModel.DesignerCategoryAttribute("code"),  _
     System.Web.Services.WebServiceBindingAttribute(Name:="checkVatTestBinding", [Namespace]:="urn:ec.europa.eu:taxud:vies:services:checkVat")>  _
    Partial Public Class checkVatTestService
        Inherits System.Web.Services.Protocols.SoapHttpClientProtocol
        
        Private checkVatOperationCompleted As System.Threading.SendOrPostCallback
        
        Private checkVatApproxOperationCompleted As System.Threading.SendOrPostCallback
        
        Private useDefaultCredentialsSetExplicitly As Boolean
        
        '''<remarks/>
        Public Sub New()
            MyBase.New
            Me.Url = Global.VERAG_PROG_ALLGEMEIN.My.MySettings.Default.VERAG_PROG_ALLGEMEIN_eu_europa_ec_checkVatTestService
            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 checkVatCompleted As checkVatCompletedEventHandler
        
        '''<remarks/>
        Public Event checkVatApproxCompleted As checkVatApproxCompletedEventHandler
        
        '''<remarks/>
        <System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace:="urn:ec.europa.eu:taxud:vies:services:checkVat:types", ResponseNamespace:="urn:ec.europa.eu:taxud:vies:services:checkVat:types", Use:=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)>  _
        Public Function checkVat(ByRef countryCode As String, ByRef vatNumber As String, ByRef valid As Boolean, <System.Xml.Serialization.XmlElementAttribute(IsNullable:=true)> ByRef name As String, <System.Xml.Serialization.XmlElementAttribute(IsNullable:=true)> ByRef address As String) As <System.Xml.Serialization.XmlElementAttribute("requestDate", DataType:="date")> Date
            Dim results() As Object = Me.Invoke("checkVat", New Object() {countryCode, vatNumber})
            countryCode = CType(results(1),String)
            vatNumber = CType(results(2),String)
            valid = CType(results(3),Boolean)
            name = CType(results(4),String)
            address = CType(results(5),String)
            Return CType(results(0),Date)
        End Function
        
        '''<remarks/>
        Public Overloads Sub checkVatAsync(ByVal countryCode As String, ByVal vatNumber As String)
            Me.checkVatAsync(countryCode, vatNumber, Nothing)
        End Sub
        
        '''<remarks/>
        Public Overloads Sub checkVatAsync(ByVal countryCode As String, ByVal vatNumber As String, ByVal userState As Object)
            If (Me.checkVatOperationCompleted Is Nothing) Then
                Me.checkVatOperationCompleted = AddressOf Me.OncheckVatOperationCompleted
            End If
            Me.InvokeAsync("checkVat", New Object() {countryCode, vatNumber}, Me.checkVatOperationCompleted, userState)
        End Sub
        
        Private Sub OncheckVatOperationCompleted(ByVal arg As Object)
            If (Not (Me.checkVatCompletedEvent) Is Nothing) Then
                Dim invokeArgs As System.Web.Services.Protocols.InvokeCompletedEventArgs = CType(arg,System.Web.Services.Protocols.InvokeCompletedEventArgs)
                RaiseEvent checkVatCompleted(Me, New checkVatCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState))
            End If
        End Sub
        
        '''<remarks/>
        <System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace:="urn:ec.europa.eu:taxud:vies:services:checkVat:types", ResponseNamespace:="urn:ec.europa.eu:taxud:vies:services:checkVat:types", Use:=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)>  _
        Public Function checkVatApprox( _
                    ByRef countryCode As String,  _
                    ByRef vatNumber As String,  _
                    ByRef traderName As String,  _
                    ByRef traderCompanyType As String,  _
                    ByRef traderStreet As String,  _
                    ByRef traderPostcode As String,  _
                    ByRef traderCity As String,  _
                    ByVal requesterCountryCode As String,  _
                    ByVal requesterVatNumber As String,  _
                    ByRef valid As Boolean,  _
                    ByRef traderAddress As String,  _
                    ByRef traderNameMatch As matchCode,  _
                    <System.Xml.Serialization.XmlIgnoreAttribute()> ByRef traderNameMatchSpecified As Boolean,  _
                    ByRef traderCompanyTypeMatch As matchCode,  _
                    <System.Xml.Serialization.XmlIgnoreAttribute()> ByRef traderCompanyTypeMatchSpecified As Boolean,  _
                    ByRef traderStreetMatch As matchCode,  _
                    <System.Xml.Serialization.XmlIgnoreAttribute()> ByRef traderStreetMatchSpecified As Boolean,  _
                    ByRef traderPostcodeMatch As matchCode,  _
                    <System.Xml.Serialization.XmlIgnoreAttribute()> ByRef traderPostcodeMatchSpecified As Boolean,  _
                    ByRef traderCityMatch As matchCode,  _
                    <System.Xml.Serialization.XmlIgnoreAttribute()> ByRef traderCityMatchSpecified As Boolean,  _
                    ByRef requestIdentifier As String) As <System.Xml.Serialization.XmlElementAttribute("requestDate", DataType:="date")> Date
            Dim results() As Object = Me.Invoke("checkVatApprox", New Object() {countryCode, vatNumber, traderName, traderCompanyType, traderStreet, traderPostcode, traderCity, requesterCountryCode, requesterVatNumber})
            countryCode = CType(results(1),String)
            vatNumber = CType(results(2),String)
            traderName = CType(results(3),String)
            traderCompanyType = CType(results(4),String)
            traderStreet = CType(results(5),String)
            traderPostcode = CType(results(6),String)
            traderCity = CType(results(7),String)
            valid = CType(results(8),Boolean)
            traderAddress = CType(results(9),String)
            traderNameMatch = CType(results(10),matchCode)
            traderNameMatchSpecified = CType(results(11),Boolean)
            traderCompanyTypeMatch = CType(results(12),matchCode)
            traderCompanyTypeMatchSpecified = CType(results(13),Boolean)
            traderStreetMatch = CType(results(14),matchCode)
            traderStreetMatchSpecified = CType(results(15),Boolean)
            traderPostcodeMatch = CType(results(16),matchCode)
            traderPostcodeMatchSpecified = CType(results(17),Boolean)
            traderCityMatch = CType(results(18),matchCode)
            traderCityMatchSpecified = CType(results(19),Boolean)
            requestIdentifier = CType(results(20),String)
            Return CType(results(0),Date)
        End Function
        
        '''<remarks/>
        Public Overloads Sub checkVatApproxAsync(ByVal countryCode As String, ByVal vatNumber As String, ByVal traderName As String, ByVal traderCompanyType As String, ByVal traderStreet As String, ByVal traderPostcode As String, ByVal traderCity As String, ByVal requesterCountryCode As String, ByVal requesterVatNumber As String)
            Me.checkVatApproxAsync(countryCode, vatNumber, traderName, traderCompanyType, traderStreet, traderPostcode, traderCity, requesterCountryCode, requesterVatNumber, Nothing)
        End Sub
        
        '''<remarks/>
        Public Overloads Sub checkVatApproxAsync(ByVal countryCode As String, ByVal vatNumber As String, ByVal traderName As String, ByVal traderCompanyType As String, ByVal traderStreet As String, ByVal traderPostcode As String, ByVal traderCity As String, ByVal requesterCountryCode As String, ByVal requesterVatNumber As String, ByVal userState As Object)
            If (Me.checkVatApproxOperationCompleted Is Nothing) Then
                Me.checkVatApproxOperationCompleted = AddressOf Me.OncheckVatApproxOperationCompleted
            End If
            Me.InvokeAsync("checkVatApprox", New Object() {countryCode, vatNumber, traderName, traderCompanyType, traderStreet, traderPostcode, traderCity, requesterCountryCode, requesterVatNumber}, Me.checkVatApproxOperationCompleted, userState)
        End Sub
        
        Private Sub OncheckVatApproxOperationCompleted(ByVal arg As Object)
            If (Not (Me.checkVatApproxCompletedEvent) Is Nothing) Then
                Dim invokeArgs As System.Web.Services.Protocols.InvokeCompletedEventArgs = CType(arg,System.Web.Services.Protocols.InvokeCompletedEventArgs)
                RaiseEvent checkVatApproxCompleted(Me, New checkVatApproxCompletedEventArgs(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.8.9037.0"),  _
     System.SerializableAttribute(),  _
     System.Xml.Serialization.XmlTypeAttribute([Namespace]:="urn:ec.europa.eu:taxud:vies:services:checkVat:types")>  _
    Public Enum matchCode
        
        '''<remarks/>
        <System.Xml.Serialization.XmlEnumAttribute("1")>  _
        Item1
        
        '''<remarks/>
        <System.Xml.Serialization.XmlEnumAttribute("2")>  _
        Item2
        
        '''<remarks/>
        <System.Xml.Serialization.XmlEnumAttribute("3")>  _
        Item3
    End Enum
    
    '''<remarks/>
    <System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.9037.0")>  _
    Public Delegate Sub checkVatCompletedEventHandler(ByVal sender As Object, ByVal e As checkVatCompletedEventArgs)
    
    '''<remarks/>
    <System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.9037.0"),  _
     System.Diagnostics.DebuggerStepThroughAttribute(),  _
     System.ComponentModel.DesignerCategoryAttribute("code")>  _
    Partial Public Class checkVatCompletedEventArgs
        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 Date
            Get
                Me.RaiseExceptionIfNecessary
                Return CType(Me.results(0),Date)
            End Get
        End Property
        
        '''<remarks/>
        Public ReadOnly Property countryCode() As String
            Get
                Me.RaiseExceptionIfNecessary
                Return CType(Me.results(1),String)
            End Get
        End Property
        
        '''<remarks/>
        Public ReadOnly Property vatNumber() As String
            Get
                Me.RaiseExceptionIfNecessary
                Return CType(Me.results(2),String)
            End Get
        End Property
        
        '''<remarks/>
        Public ReadOnly Property valid() As Boolean
            Get
                Me.RaiseExceptionIfNecessary
                Return CType(Me.results(3),Boolean)
            End Get
        End Property
        
        '''<remarks/>
        Public ReadOnly Property name() As String
            Get
                Me.RaiseExceptionIfNecessary
                Return CType(Me.results(4),String)
            End Get
        End Property
        
        '''<remarks/>
        Public ReadOnly Property address() As String
            Get
                Me.RaiseExceptionIfNecessary
                Return CType(Me.results(5),String)
            End Get
        End Property
    End Class
    
    '''<remarks/>
    <System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.9037.0")>  _
    Public Delegate Sub checkVatApproxCompletedEventHandler(ByVal sender As Object, ByVal e As checkVatApproxCompletedEventArgs)
    
    '''<remarks/>
    <System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.9037.0"),  _
     System.Diagnostics.DebuggerStepThroughAttribute(),  _
     System.ComponentModel.DesignerCategoryAttribute("code")>  _
    Partial Public Class checkVatApproxCompletedEventArgs
        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 Date
            Get
                Me.RaiseExceptionIfNecessary
                Return CType(Me.results(0),Date)
            End Get
        End Property
        
        '''<remarks/>
        Public ReadOnly Property countryCode() As String
            Get
                Me.RaiseExceptionIfNecessary
                Return CType(Me.results(1),String)
            End Get
        End Property
        
        '''<remarks/>
        Public ReadOnly Property vatNumber() As String
            Get
                Me.RaiseExceptionIfNecessary
                Return CType(Me.results(2),String)
            End Get
        End Property
        
        '''<remarks/>
        Public ReadOnly Property traderName() As String
            Get
                Me.RaiseExceptionIfNecessary
                Return CType(Me.results(3),String)
            End Get
        End Property
        
        '''<remarks/>
        Public ReadOnly Property traderCompanyType() As String
            Get
                Me.RaiseExceptionIfNecessary
                Return CType(Me.results(4),String)
            End Get
        End Property
        
        '''<remarks/>
        Public ReadOnly Property traderStreet() As String
            Get
                Me.RaiseExceptionIfNecessary
                Return CType(Me.results(5),String)
            End Get
        End Property
        
        '''<remarks/>
        Public ReadOnly Property traderPostcode() As String
            Get
                Me.RaiseExceptionIfNecessary
                Return CType(Me.results(6),String)
            End Get
        End Property
        
        '''<remarks/>
        Public ReadOnly Property traderCity() As String
            Get
                Me.RaiseExceptionIfNecessary
                Return CType(Me.results(7),String)
            End Get
        End Property
        
        '''<remarks/>
        Public ReadOnly Property valid() As Boolean
            Get
                Me.RaiseExceptionIfNecessary
                Return CType(Me.results(8),Boolean)
            End Get
        End Property
        
        '''<remarks/>
        Public ReadOnly Property traderAddress() As String
            Get
                Me.RaiseExceptionIfNecessary
                Return CType(Me.results(9),String)
            End Get
        End Property
        
        '''<remarks/>
        Public ReadOnly Property traderNameMatch() As matchCode
            Get
                Me.RaiseExceptionIfNecessary
                Return CType(Me.results(10),matchCode)
            End Get
        End Property
        
        '''<remarks/>
        Public ReadOnly Property traderNameMatchSpecified() As Boolean
            Get
                Me.RaiseExceptionIfNecessary
                Return CType(Me.results(11),Boolean)
            End Get
        End Property
        
        '''<remarks/>
        Public ReadOnly Property traderCompanyTypeMatch() As matchCode
            Get
                Me.RaiseExceptionIfNecessary
                Return CType(Me.results(12),matchCode)
            End Get
        End Property
        
        '''<remarks/>
        Public ReadOnly Property traderCompanyTypeMatchSpecified() As Boolean
            Get
                Me.RaiseExceptionIfNecessary
                Return CType(Me.results(13),Boolean)
            End Get
        End Property
        
        '''<remarks/>
        Public ReadOnly Property traderStreetMatch() As matchCode
            Get
                Me.RaiseExceptionIfNecessary
                Return CType(Me.results(14),matchCode)
            End Get
        End Property
        
        '''<remarks/>
        Public ReadOnly Property traderStreetMatchSpecified() As Boolean
            Get
                Me.RaiseExceptionIfNecessary
                Return CType(Me.results(15),Boolean)
            End Get
        End Property
        
        '''<remarks/>
        Public ReadOnly Property traderPostcodeMatch() As matchCode
            Get
                Me.RaiseExceptionIfNecessary
                Return CType(Me.results(16),matchCode)
            End Get
        End Property
        
        '''<remarks/>
        Public ReadOnly Property traderPostcodeMatchSpecified() As Boolean
            Get
                Me.RaiseExceptionIfNecessary
                Return CType(Me.results(17),Boolean)
            End Get
        End Property
        
        '''<remarks/>
        Public ReadOnly Property traderCityMatch() As matchCode
            Get
                Me.RaiseExceptionIfNecessary
                Return CType(Me.results(18),matchCode)
            End Get
        End Property
        
        '''<remarks/>
        Public ReadOnly Property traderCityMatchSpecified() As Boolean
            Get
                Me.RaiseExceptionIfNecessary
                Return CType(Me.results(19),Boolean)
            End Get
        End Property
        
        '''<remarks/>
        Public ReadOnly Property requestIdentifier() As String
            Get
                Me.RaiseExceptionIfNecessary
                Return CType(Me.results(20),String)
            End Get
        End Property
    End Class
End Namespace
