Как бы вы передали имя пользователя и пароль веб-службе, используя этот код. Веб-сервис, который я имею в виду, имеет следующий класс аутентификации:
Public Class AuthHeader : Inherits SoapHeader
Public SalonID As String
Public SalonPassword As String
End Class
Тогда в своем классе веб-сервисов оно имеет следующее:
Public Credentials As AuthHeader 'Part of the general declarations of the class - not within any particular method
Private Function AuthenticateUser(ByVal ID As String, ByVal PassWord As String, ByVal theHeader As AuthHeader) As Boolean
If (Not (ID Is Nothing) And Not (PassWord Is Nothing)) Then
If ((ID = "1")) And (PassWord = "PWD")) Then
Return True
Else
Return False
End If
Else
Return False
End If
End Function
<WebMethod(Description:="Authenticat User."), SoapHeader("Credentials")> _
Public Function AreYouAlive() As Boolean
Dim SalonID As String = Credentials.SalonID
Dim SalonPassword As String = Credentials.SalonPassword
If (AuthenticateUser(ID, Password, Credentials)) Then
Return True
Else
Return False
End If
End Function
Я обнаружил, что не могу получить прокси-класс, который вы упомянули выше, чтобы передать имя пользователя и пароль этому