3

我正在使用 CustomBinding 来启用 Soap 1.1(端点不支持 1.2)+ Addressing 1.0。端点只能通过 SSL 使用,并且在某种 Java/Weblogic 平台上运行。

这是我的配置:

<customBinding>
    <binding name="Soap11Addr10">
        <textMessageEncoding messageVersion="Soap11WSAddressing10" />
        <httpsTransport/>
    </binding>
</customBinding>

[...]

<endpoint address="https://sekrit:444/more-sekrits/even-more"
    binding="customBinding" bindingConfiguration="Soap11Addr10"
    contract="SomePort" name="SomePortService" />

此配置似乎使端点感到困惑。当我对 SomePort 执行请求时,WCF 首先发送一个 RequestSecurityTokenResponse 消息,我认为这可能是不幸的。这是 RSTR 信封的踪迹:

<s:Envelope xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:s="http://www.w3.org/2003/05/soap-envelope">
  <s:Header>
    <a:Action s:mustUnderstand="1">http://schemas.xmlsoap.org/ws/2005/02/trust/RSTR/Issue</a:Action>
    <a:RelatesTo>urn:uuid:7348d908-b767-43e8-9770-09a38461ee87</a:RelatesTo>
  </s:Header>
  <s:Body>
    <t:RequestSecurityTokenResponse Context="uuid-7a3c9fde-053d-46e7-aa08-f5725b082691-287" xmlns:t="http://schemas.xmlsoap.org/ws/2005/02/trust" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
      <t:BinaryExchange ValueType="http://schemas.xmlsoap.org/ws/2005/02/trust/spnego" EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">TlRMTVNTUAACAAAAEAAQADgAAAA1wpriPjzjL4iwIJhAmcsBAAAAAGAAYABIAAAABgByFwAAAA9TAEsATwBHAEsAQQBUAFQAAgAQAFMASwBPAEcASwBBAFQAVAABABAAUwBLAE8ARwBLAEEAVABUAAQAEABTAGsAbwBnAGsAYQB0AHQAAwAQAFMAawBvAGcAawBhAHQAdAAHAAgAj73D884kywEAAAAA</t:BinaryExchange>
    </t:RequestSecurityTokenResponse>
  </s:Body>
</s:Envelope>

端点 barfs:

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
  <env:Header></env:Header>
  <env:Body>
    <env:Fault xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope/">
      <faultcode xmlns="">ns0:MustUnderstand</faultcode>
      <faultstring xml:lang="en" xmlns="">One or more mandatory SOAP header blocks not understood</faultstring>
    </env:Fault>
  </env:Body>
</env:Envelope>

是否可以停止发送初始 RSTR?

我可以根据要求提供更多跟踪和日志数据。

4

1 回答 1

0

如果不了解目标服务的更多信息,很难说出它的预期,但我猜想 WCF 正在使用消息安全性,这意味着每条消息都是单独加密的。您可能只需要传输级别的安全性(即 https)。

您可以尝试<security mode="Transport" />在绑定配置中进行设置。

于 2011-02-22T14:13:28.610 回答