2011-10-31 5 views
2

誰かが私を助けてくれることを願っています。

WSSEセキュリティヘッダー

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

私が使用しています:私は、私は、Webサービスとの認証のために、以下の情報を渡す必要があると言われてい
https://link.hertz.com/AuthenticationWebservice/authenticateAdmin?wsdl

このWebサービスを呼び出すしようとしています

asp.net 4.0のアプリケーションで、WebサービスコールにWSS-Passwordタイプを渡す方法がわかりません。

私はasp.netアプリケーションでのサービスのリファレンスとして、このサービスのURLを追加したと私は私のasp.netのページに次のコードを使用しています

:事前に

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

myClient.authenticateAdminCredentials(myUserName, myPassword, myDomain); 

おかげで、

ハリ

答えて

2

これは、exampleを使用しており、私たちのために働いています。私たちはSecurityHeaderの "genericity"のためにこれを変更しました:

 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); 
     } 
+0

こんにちは、まずはお返事ありがとうございます。あなたの提案を含めるようにコードを変更しました。しかし、私は例外を取得しています:

ヘッダーの処理中にエラーが検出されました。
よくわからない、今すぐどうぞ? – Hari

関連する問題