I've created a web service , which can a method to set the user credential using Microsoft.Web.Services3.WebServicesClientProtocol
. The sample code is :
<WebMethod()> _
Public Sub ClientCredential1(Of TSecurityToken As SecurityToken)_
(ByVal UserCred As Microsoft.Web.Services3.Security.Tokens.UsernameToken)
Dim cProxy As New Microsoft.Web.Services3.WebServicesClientProtocol()
cProxy.SetClientCredential(UserCred)
End Sub
When I run the web service it gives this error:
"Microsoft.Web.Services3.Security.Tokens.UsernameToken cannot be serialized because it does not have a parameterless constructor."
Does any one know where is the problem ?