2012-03-13 8 views
0

私たちはC#を使用してSOAP経由でXMLデータを送信しています。サービスは、#PasswordDigest#Base64Binary NonceでHttpDigest認証が必要です。私たちのbindingコード:ダイジェスト認証を使用するWebサービスの使用

protected BasicHttpBinding binding = new BasicHttpBinding() 
{ 
      Name = "ShipmentServiceSoapBinding", 
      CloseTimeout = new TimeSpan(0, 01, 0), 
      OpenTimeout = new TimeSpan(0, 01, 0), 
      ReceiveTimeout = new TimeSpan(0, 10, 0), 
      SendTimeout = new TimeSpan(0, 5, 0), 
      AllowCookies = false, 
      BypassProxyOnLocal = false, 
      HostNameComparisonMode = HostNameComparisonMode.StrongWildcard, 
      MaxBufferPoolSize = 5242880, 
      MaxReceivedMessageSize = 655360, 
      MessageEncoding = WSMessageEncoding.Text , 
      TextEncoding = new UTF8Encoding(), 
      UseDefaultWebProxy = true, 
      ReaderQuotas = new XmlDictionaryReaderQuotas() { MaxDepth = 32, MaxStringContentLength = 81920, MaxArrayLength = 1638400, MaxBytesPerRead = 409600, MaxNameTableCharCount = 163840 }, 
      Security = new BasicHttpSecurity() { Mode = BasicHttpSecurityMode.TransportWithMessageCredential, 
               //Message = new BasicHttpMessageSecurity() { AlgorithmSuite = SecurityAlgorithmSuite.Default, ClientCredentialType = BasicHttpMessageCredentialType.UserName}, 
               Transport = new HttpTransportSecurity(){ ClientCredentialType = HttpClientCredentialType.Digest}}, 

}; 

私たちが選択しているBasicHttpSecurityModeの種類に基づいて、3種類の問題が発生しています。

  1. 交通 - XMLは、すべてのセキュリティ情報が含まれていない
  2. TransportCredentialOnly - 私たちは、エンドポイントがhttpsすることができないという状態を取得エラー://
  3. TransportWithMessagecredential - これは
ダイジェスト使用していません

ServiceReferenceでClientCredentialsクラスを使用できるようになりましたので、ここではHttpDigestを使ってみました:

私は他のStackOverflowの質問を読んだことがあります。ダイジェストでは、AuthHeaderでSoapHeaderを使用する必要がありますが、APIにあるものと一致させる方法はありません。それを行う他の方法はありますか?または、そのAPIがC#用に正しく書かれていないのですか?

答えて