I created a soap based web service and create a function named SetclientCredential which set the client credential using Microsoft.Web.Services3.Security.Tokens.UsernameToken the code sample is given below:
<SoapDocumentMethod(Action:="http://tempuri.org/SetClientCredential", _
RequestNamespace:="http://tempuri.org/", _
RequestElementName:="GetUserNameRequest", _
ResponseNamespace:="http://tempuri.org/", _
ResponseElementName:="GetUserNameResponse"), _
WebMethod(Description:="Obtains the User Name")> _
Public Sub SetClientCredential(ByVal username As String, ByVal userpass As String)
username = "ADMIN"
userpass = "password"
Dim usernametoken As New Microsoft.Web.Services3.Security.Tokens.UsernameToken(username, userpass)
Dim cProxy As New Microsoft.Web.Services3.WebServicesClientProtocol
cProxy.SetClientCredential(usernametoken)
End Sub
Then I debug the service it gave exception on :
Dim cProxy As New Microsoft.Web.Services3.WebServicesClientProtocol
The Exception stated that : Dim cProxy As New Microsoft.Web.Services3.WebServicesClientProtocol.
Does anybody know where is the problem.
Thanks