2

Hope somebody can help me out.

I am trying to call this Web Service
https://link.hertz.com/AuthenticationWebservice/authenticateAdmin?wsdl

I have been said that I need to pass the following info for authentication with the web service:

username => "webServiceUserName"
password => "webServicePassword"
WSS-Password Type => "PasswordDigest"

I am using an asp.net 4.0 application and unable to figure out how to pass WSS-Password type to my web service call.

I have added this service url as a Service reference in my asp.net application and I am using the following code in my asp.net page:

service1.AuthenticateAdminClient myClient = new service1.AuthenticateAdminClient();
myClient.ClientCredentials.UserName.UserName = "webServiceUserName";
wsClient.ClientCredentials.UserName.Password = "webServicePassword";

myClient.authenticateAdminCredentials(myUserName, myPassword, myDomain);

thanks in advance,

Hari

Mansoor Gee
  • 1,071
  • 8
  • 20
Hari
  • 477
  • 1
  • 9
  • 20

1 Answers1

2

We used this example and it works for us. We just changed for "genericity" this one in SecurityHeader:

        if (PasswordType == PasswordType.Digest)
        {
            writer.WriteAttributeString("Type", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest");
            writer.WriteString(ComputePasswordDigest(SystemPassword, nonce, created));
        }
        else if (PasswordType == PasswordType.Text)
        {
            writer.WriteAttributeString("Type", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText");
            writer.WriteString(SystemPassword);
        }
sasjaq
  • 761
  • 1
  • 11
  • 31
  • hi,first of all, thanks for the reply. I made changes in my code to include your suggestion; but i am getting the exception:

    An error was discovered processing the header.
    Not sure, wot to do now?
    – Hari Oct 31 '11 at 13:07