'------------------------------------------------------------------------------
' <auto-generated>
'     このコードはツールによって生成されました。
'     ランタイム バージョン:2.0.50727.42
'
'     このファイルへの変更は、以下の状況下で不正な動作の原因になったり、
'     コードが再生成されるときに損失したりします。
' </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

'
'このソース コードは Microsoft.VSDesigner、バージョン 2.0.50727.42 によって自動生成されました。
'
Namespace ServiceReference
    
    '''<remarks/>
    <System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.42"),  _
     System.Diagnostics.DebuggerStepThroughAttribute(),  _
     System.ComponentModel.DesignerCategoryAttribute("code"),  _
     System.Web.Services.WebServiceBindingAttribute(Name:="ServiceSoap", [Namespace]:="http://tempuri.org/")>  _
    Partial Public Class Service
        Inherits System.Web.Services.Protocols.SoapHttpClientProtocol
        
        Private MethodWithoutAuthenticationOperationCompleted As System.Threading.SendOrPostCallback
        
        Private MethodWithAuthenticationOperationCompleted As System.Threading.SendOrPostCallback
        
        Private useDefaultCredentialsSetExplicitly As Boolean
        
        '''<remarks/>
        Public Sub New()
            MyBase.New
            Me.Url = Global.BusinessWindows.My.MySettings.Default.BusinessWindows_ServiceReference_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 MethodWithoutAuthenticationCompleted As MethodWithoutAuthenticationCompletedEventHandler
        
        '''<remarks/>
        Public Event MethodWithAuthenticationCompleted As MethodWithAuthenticationCompletedEventHandler
        
        '''<remarks/>
        <System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/MethodWithoutAuthentication", RequestNamespace:="http://tempuri.org/", ResponseNamespace:="http://tempuri.org/", Use:=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)>  _
        Public Sub MethodWithoutAuthentication()
            Me.Invoke("MethodWithoutAuthentication", New Object(-1) {})
        End Sub
        
        '''<remarks/>
        Public Overloads Sub MethodWithoutAuthenticationAsync()
            Me.MethodWithoutAuthenticationAsync(Nothing)
        End Sub
        
        '''<remarks/>
        Public Overloads Sub MethodWithoutAuthenticationAsync(ByVal userState As Object)
            If (Me.MethodWithoutAuthenticationOperationCompleted Is Nothing) Then
                Me.MethodWithoutAuthenticationOperationCompleted = AddressOf Me.OnMethodWithoutAuthenticationOperationCompleted
            End If
            Me.InvokeAsync("MethodWithoutAuthentication", New Object(-1) {}, Me.MethodWithoutAuthenticationOperationCompleted, userState)
        End Sub
        
        Private Sub OnMethodWithoutAuthenticationOperationCompleted(ByVal arg As Object)
            If (Not (Me.MethodWithoutAuthenticationCompletedEvent) Is Nothing) Then
                Dim invokeArgs As System.Web.Services.Protocols.InvokeCompletedEventArgs = CType(arg,System.Web.Services.Protocols.InvokeCompletedEventArgs)
                RaiseEvent MethodWithoutAuthenticationCompleted(Me, New System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState))
            End If
        End Sub
        
        '''<remarks/>
        <System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/MethodWithAuthentication", RequestNamespace:="http://tempuri.org/", ResponseNamespace:="http://tempuri.org/", Use:=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)> _
        <BusinessCommon.AuthenticationExtension()> _
        Public Sub MethodWithAuthentication()
            Me.Invoke("MethodWithAuthentication", New Object(-1) {})
        End Sub
        
        '''<remarks/>
        Public Overloads Sub MethodWithAuthenticationAsync()
            Me.MethodWithAuthenticationAsync(Nothing)
        End Sub
        
        '''<remarks/>
        Public Overloads Sub MethodWithAuthenticationAsync(ByVal userState As Object)
            If (Me.MethodWithAuthenticationOperationCompleted Is Nothing) Then
                Me.MethodWithAuthenticationOperationCompleted = AddressOf Me.OnMethodWithAuthenticationOperationCompleted
            End If
            Me.InvokeAsync("MethodWithAuthentication", New Object(-1) {}, Me.MethodWithAuthenticationOperationCompleted, userState)
        End Sub
        
        Private Sub OnMethodWithAuthenticationOperationCompleted(ByVal arg As Object)
            If (Not (Me.MethodWithAuthenticationCompletedEvent) Is Nothing) Then
                Dim invokeArgs As System.Web.Services.Protocols.InvokeCompletedEventArgs = CType(arg,System.Web.Services.Protocols.InvokeCompletedEventArgs)
                RaiseEvent MethodWithAuthenticationCompleted(Me, New System.ComponentModel.AsyncCompletedEventArgs(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", "2.0.50727.42")>  _
    Public Delegate Sub MethodWithoutAuthenticationCompletedEventHandler(ByVal sender As Object, ByVal e As System.ComponentModel.AsyncCompletedEventArgs)
    
    '''<remarks/>
    <System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.42")>  _
    Public Delegate Sub MethodWithAuthenticationCompletedEventHandler(ByVal sender As Object, ByVal e As System.ComponentModel.AsyncCompletedEventArgs)
End Namespace
