Link to home
Start Free TrialLog in
Avatar of rocky050371
rocky050371

asked on

WSE1.0 to WSE3.0

I am upgrading a project from WSE 1 TO 3, I have the following code on the client

        Dim proxy As New TestWS.DataServiceWse
        proxy.Url = WSLocation
        Dim reqCtx As SoapContext = proxy.RequestSoapContext
        Dim tok As New UsernameToken(EmailAddress, Password, PasswordOption.SendHashed)
        reqCtx.Security.Tokens.Add(tok)
        reqCtx.Security.Elements.Add(New Signature(tok))
        Return proxy


And on the web service

 Private Function Authenticater() As Boolean

        Dim requestContext As SoapContext = HttpSoapContext.RequestContext
        Dim userToken As UsernameToken
   
        If requestContext Is Nothing Then
            Throw New SoapException("Only SOAP requests are accepted", _
                            SoapException.ClientFaultCode)
        End If

        For Each userToken In requestContext.Security.Tokens
            If TypeOf userToken Is UsernameToken Then
                If userToken.PasswordOption = PasswordOption.SendHashed Then
                    Return True
                    Exit For
                Else
                    Throw New SoapException("The password must be hashed", SoapException.ClientFaultCode)
                End If
            End If
        Next
    End Function

does anyone before I upgrade whether this will work with 3?
ASKER CERTIFIED SOLUTION
Avatar of Mikal613
Mikal613
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rocky050371
rocky050371

ASKER

This is no quite what I was after