'------------------------------------------------------------------------------
' <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 at.gv.bmf.finanzonline.session
    
    '''<remarks/>
    <System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.9037.0"),  _
     System.Diagnostics.DebuggerStepThroughAttribute(),  _
     System.ComponentModel.DesignerCategoryAttribute("code"),  _
     System.Web.Services.WebServiceBindingAttribute(Name:="sessionServiceBinding", [Namespace]:="https://finanzonline.bmf.gv.at/fon/ws/session")>  _
    Partial Public Class sessionService
        Inherits System.Web.Services.Protocols.SoapHttpClientProtocol
        
        Private loginOperationCompleted As System.Threading.SendOrPostCallback
        
        Private logoutOperationCompleted 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_at_gv_bmf_finanzonline_session_sessionService
            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 loginCompleted As loginCompletedEventHandler
        
        '''<remarks/>
        Public Event logoutCompleted As logoutCompletedEventHandler
        
        '''<remarks/>
        <System.Web.Services.Protocols.SoapDocumentMethodAttribute("login", RequestElementName:="loginRequest", RequestNamespace:="https://finanzonline.bmf.gv.at/fon/ws/session", ResponseNamespace:="https://finanzonline.bmf.gv.at/fon/ws/session", Use:=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)>  _
        Public Function login(ByVal tid As String, ByVal benid As String, ByVal pin As String, ByVal herstellerid As String, ByRef rc As Integer, ByRef msg As String) As <System.Xml.Serialization.XmlElementAttribute("id")> String
            Dim results() As Object = Me.Invoke("login", New Object() {tid, benid, pin, herstellerid})
            rc = CType(results(1),Integer)
            msg = CType(results(2),String)
            Return CType(results(0),String)
        End Function
        
        '''<remarks/>
        Public Overloads Sub loginAsync(ByVal tid As String, ByVal benid As String, ByVal pin As String, ByVal herstellerid As String)
            Me.loginAsync(tid, benid, pin, herstellerid, Nothing)
        End Sub
        
        '''<remarks/>
        Public Overloads Sub loginAsync(ByVal tid As String, ByVal benid As String, ByVal pin As String, ByVal herstellerid As String, ByVal userState As Object)
            If (Me.loginOperationCompleted Is Nothing) Then
                Me.loginOperationCompleted = AddressOf Me.OnloginOperationCompleted
            End If
            Me.InvokeAsync("login", New Object() {tid, benid, pin, herstellerid}, Me.loginOperationCompleted, userState)
        End Sub
        
        Private Sub OnloginOperationCompleted(ByVal arg As Object)
            If (Not (Me.loginCompletedEvent) Is Nothing) Then
                Dim invokeArgs As System.Web.Services.Protocols.InvokeCompletedEventArgs = CType(arg,System.Web.Services.Protocols.InvokeCompletedEventArgs)
                RaiseEvent loginCompleted(Me, New loginCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState))
            End If
        End Sub
        
        '''<remarks/>
        <System.Web.Services.Protocols.SoapDocumentMethodAttribute("logout", RequestElementName:="logoutRequest", RequestNamespace:="https://finanzonline.bmf.gv.at/fon/ws/session", ResponseNamespace:="https://finanzonline.bmf.gv.at/fon/ws/session", Use:=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)>  _
        Public Function logout(ByVal tid As String, ByVal benid As String, ByVal id As String, ByRef msg As String) As <System.Xml.Serialization.XmlElementAttribute("rc")> Integer
            Dim results() As Object = Me.Invoke("logout", New Object() {tid, benid, id})
            msg = CType(results(1),String)
            Return CType(results(0),Integer)
        End Function
        
        '''<remarks/>
        Public Overloads Sub logoutAsync(ByVal tid As String, ByVal benid As String, ByVal id As String)
            Me.logoutAsync(tid, benid, id, Nothing)
        End Sub
        
        '''<remarks/>
        Public Overloads Sub logoutAsync(ByVal tid As String, ByVal benid As String, ByVal id As String, ByVal userState As Object)
            If (Me.logoutOperationCompleted Is Nothing) Then
                Me.logoutOperationCompleted = AddressOf Me.OnlogoutOperationCompleted
            End If
            Me.InvokeAsync("logout", New Object() {tid, benid, id}, Me.logoutOperationCompleted, userState)
        End Sub
        
        Private Sub OnlogoutOperationCompleted(ByVal arg As Object)
            If (Not (Me.logoutCompletedEvent) Is Nothing) Then
                Dim invokeArgs As System.Web.Services.Protocols.InvokeCompletedEventArgs = CType(arg,System.Web.Services.Protocols.InvokeCompletedEventArgs)
                RaiseEvent logoutCompleted(Me, New logoutCompletedEventArgs(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.Web.Services", "4.8.9037.0")>  _
    Public Delegate Sub loginCompletedEventHandler(ByVal sender As Object, ByVal e As loginCompletedEventArgs)
    
    '''<remarks/>
    <System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.9037.0"),  _
     System.Diagnostics.DebuggerStepThroughAttribute(),  _
     System.ComponentModel.DesignerCategoryAttribute("code")>  _
    Partial Public Class loginCompletedEventArgs
        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 String
            Get
                Me.RaiseExceptionIfNecessary
                Return CType(Me.results(0),String)
            End Get
        End Property
        
        '''<remarks/>
        Public ReadOnly Property rc() As Integer
            Get
                Me.RaiseExceptionIfNecessary
                Return CType(Me.results(1),Integer)
            End Get
        End Property
        
        '''<remarks/>
        Public ReadOnly Property msg() As String
            Get
                Me.RaiseExceptionIfNecessary
                Return CType(Me.results(2),String)
            End Get
        End Property
    End Class
    
    '''<remarks/>
    <System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.9037.0")>  _
    Public Delegate Sub logoutCompletedEventHandler(ByVal sender As Object, ByVal e As logoutCompletedEventArgs)
    
    '''<remarks/>
    <System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.9037.0"),  _
     System.Diagnostics.DebuggerStepThroughAttribute(),  _
     System.ComponentModel.DesignerCategoryAttribute("code")>  _
    Partial Public Class logoutCompletedEventArgs
        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 Integer
            Get
                Me.RaiseExceptionIfNecessary
                Return CType(Me.results(0),Integer)
            End Get
        End Property
        
        '''<remarks/>
        Public ReadOnly Property msg() As String
            Get
                Me.RaiseExceptionIfNecessary
                Return CType(Me.results(1),String)
            End Get
        End Property
    End Class
End Namespace
