0

i have .asmx webservice that is secured. if the authentication is successful then an authentication token is issued. however, i am making some jQuery calls and I wanted to know how to send a authentication token as a part of the SOAP header.

the following is the .NET equivalent code.

svc = new SecuredWebService.SecuredWebService();
svc.SoapHeader = new SecuredWebService.SecuredWebServiceHeader();
svc.SoapHeader.Username = "test";
svc.SoapHeader.Password = "test";

Guid g;
string token = svc.AuthenticateUser();

if (Guid.TryParse(token, out g) == true)
{
    //    auth.AuthenticatedToken = token;
    svc.SoapHeader.AuthenticatedToken = token;
    serverlbl.Text = (token);
}

serverlbl.Text += ":";
serverlbl.Text += svc.HelloWorld();

the authentication token is required for each web request.

4

0 回答 0