1

次の応答メッセージを返す Web サービスを使用できるように WCF クライアントを構成しようとしています。

応答メッセージ

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns0="http://myservice.wsdl">
  <env:Header>
    <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" env:mustUnderstand="1" />
  </env:Header>
  <env:Body>
    <ns0:StatusResponse>
      <result>
        ...
      </result>
    </ns0:StatusResponse>
  </env:Body>
</env:Envelope>

これを行うために、カスタム バインディングを作成しました (これは機能しません)。「セキュリティ ヘッダーが空です」というメッセージが表示され続けます。

私のバインディング:

<customBinding>
    <binding name="myCustomBindingForVestaServices">
      <security authenticationMode="UserNameOverTransport"
            messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11"
            securityHeaderLayout="Strict"
            includeTimestamp="false"
            requireDerivedKeys="true">
      </security>
      <textMessageEncoding messageVersion="Soap11" />
      <httpsTransport authenticationScheme="Negotiate" requireClientCertificate ="false" realm =""/>
    </binding>
  </customBinding>

私の要求は、応答として同じ SOAP および WS Security バージョンを使用しているようですが、異なる名前空間プレフィックス (「wsse」ではなく「o」) を使用しています。これが、「セキュリティ ヘッダーが空です」というメッセージが表示され続ける理由でしょうか?

リクエストメッセージ

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
  <s:Header>
    <o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
      <o:UsernameToken u:Id="uuid-d3b70d1f-0ebb-4a79-85e6-34f0d6aa3d0f-1">
        <o:Username>user</o:Username>
        <o:Password>pass</o:Password>
      </o:UsernameToken>
    </o:Security>
  </s:Header>
  <s:Body>
    <getPrdStatus xmlns="http://myservice.wsdl">
      <request xmlns="" xmlns:a="http://myservice.wsdl" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
        ...
      </request>
    </getPrdStatus>
  </s:Body>
</s:Envelope>

この Web サービスを使用できるようにするには、WCF クライアント バインディングをどのように構成する必要がありますか?

どんな助けでも大歓迎です!

サンダー

4

1 に答える 1

0

私の問題は次の KB 記事で解決されているようです: http://support.microsoft.com/kb/971493/

ダウンロード リンクが利用できないため、まだ修正プログラムをダウンロードできていません。このスレッドは更新され続けます。

于 2010-04-07T15:52:01.463 に答える