How would you skip the username and password for the web service using this code. The web service that I mean has the following authentication class:
Public Class AuthHeader : Inherits SoapHeader
Public SalonID As String
Public SalonPassword As String
End Class
Then, inside this web service class, it has the following:
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
I find that I cannot get the proxy class mentioned above to pass username and password to this
source
share