Page tree
Skip to end of metadata
Go to start of metadata

Here is what we are dealing with right now.
We purchased WS-Security texts and posting questions to the MSDN Webservice forums, I have been unable to implement the WS-Security UsernameToken specification within Visual Studio 2005. From almost all sources, the only examples and advice I have received require the security specs to be defined within the web service WSDL which defines the service and its classes for all web clients. (AAP is building the web client in this instance.) Since the WS-Security spec is only a recommendation and is not explicitly defined in the Medbiquitous schema/WSDL, I am unable to program the client (within .NET) to send an undefined custom class (UsernameToken) in the SOAP Header
And here is the code:
Imports Microsoft.Web.Services3
Imports Microsoft.Web.Services3.Security.Tokens
Imports Microsoft.Web.Services3.Security.Tokens.UsernameTokenManager
Imports Microsoft.Web.Services3.Security.Tokens.SecurityToken
Dim ws As New MemberService.Member
[Scenario One]
        Dim userToken As UsernameToken
        userToken = New UsernameToken("Bill", "Bubbles", PasswordOption.SendPlainText)
        Dim security As Security = Nothing
        Dim requestContext As SoapContext = HttpSoapContext.RequestContext()
This gereates errors:
Error 1 Name 'HttpSoapContext' is not declared.
Error 2 'RequestSoapContext' is not a member of 'MemberService.Member'.
[Scenario Two]
        Dim token As UsernameToken = Nothing
        Dim username As String = "aapclient"
        Dim password As String = "if9swe23"
        token = New UsernameToken(username, password)
        ' Username and password are set through code.
        ws.SetClientCredential(Of UsernameToken)(token)
This gereates errors:
Error 1 'SetClientCredential' is not a member of 'MemberService.Member'.
Error 2 'SetPolicy' is not a member of 'MemberService.Member'.

  • No labels