簡體   English   中英

WCF:CustomBinding會混淆端點

[英]WCF: CustomBinding confuses endpoint

我使用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?

我可以根據要求提供更多的跟蹤和日志數據。

在不了解目標服務的情況下,很難說出它的期望,但我猜想WCF正在使用消息安全性,這意味着每條消息都是單獨加密的。 您可能只想要傳輸級安全性(即https)。

您可以嘗試在綁定配置中設置<security mode="Transport" />

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM