1

カスタム WCF サービス クライアントを実装しようとしています。サーバーは、クライアント資格情報なしで wHttpBinding とメッセージ セキュリティを使用します。TLS ハンドシェイクを開始するには、適切な SOAP エンベロープをプログラムで作成する必要があります。標準の WCF クライアントからの最初の要求をキャプチャしました。メッセージは次のようになります。

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing">
   <s:Header>
      <a:Action s:mustUnderstand="1">http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue</a:Action>
      <a:MessageID>urn:uuid:f88d1721-29ce-4418-994e-a3796f053e63</a:MessageID>
      <a:ReplyTo>
         <a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address>
      </a:ReplyTo>
      <a:To s:mustUnderstand="1">http://localhost:56635/Service1.svc</a:To>
   </s:Header>
   <s:Body>
      <t:RequestSecurityToken xmlns:t="http://schemas.xmlsoap.org/ws/2005/02/trust" Context="uuid-6549ee11-0349-4dbc-8686-6b7f0b079251-1">
         <t:TokenType>http://schemas.xmlsoap.org/ws/2005/02/sc/sct</t:TokenType>
         <t:RequestType>http://schemas.xmlsoap.org/ws/2005/02/trust/Issue</t:RequestType>
         <t:KeySize>256</t:KeySize>
         <t:BinaryExchange ValueType="http://schemas.xmlsoap.org/ws/2005/02/trust/tlsnego" EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">FgMBAFoBAABWAwFPQ8mbvU/nL8Cgu/CRIhhvVyRAYNdppNpdUY2UEi/GLQAAGAAvADUABQAKwBPAFMAJwAoAMgA4ABMABAEAABX/AQABAAAKAAYABAAXABgACwACAQA=</t:BinaryExchange>
      </t:RequestSecurityToken>
   </s:Body>
</s:Envelope>

問題は、どの値をエンコードして BinaryExchange タグに挿入する必要があるかがわからないことです。どんな助けでも大歓迎です。

4

1 に答える 1

1

あなたはその道に行きたくない。関連する 2 つの複雑な標準があります (ws-secureconversation と ssl nego)。それぞれに複数のメッセージ交換が含まれます。署名および暗号化されたすべての部分を正しく取得するには、非常に懸命に作業する必要があります。通常の WCF クライアントを使用する必要があります。

于 2012-04-11T22:42:19.223 に答える