3

我正在尝试使用统一返回自定义错误异常,但在 Rst\Issue 操作期间出现以下错误:

[服务跟踪查看器异常][1]

图片:[1]:http: //i.stack.imgur.com/oAxGT.png

  1. 没有为具有“ http://tempuri.org/IWcfServiceLayer/GetFirstOrder ”操作的消息指定签名消息部分。
  2. 安全协议无法保护传出消息
  3. RequestContext 中止

我正在使用实际上类似于 wsHttpBinding 的 custmBinding。这里我手动在 wcf 方法中抛出异常,以测试行为。

当我注释掉 throw new exception 语句时,服务工作正常并返回预期结果。但该服务目前无法处理异常。 那么为什么发生异常时服务不能保护传出消息呢?

编辑(绑定配置):

  <customBinding>
    <binding name="MyServiceBinding" closeTimeout="00:05:00" openTimeout="00:05:00"
      receiveTimeout="00:05:00" sendTimeout="00:05:00">
      <transactionFlow />
      <reliableSession maxPendingChannels="4000" maxRetryCount="20"
        maxTransferWindowSize="4000" ordered="false" />
      <security enableUnsecuredResponse="false" authenticationMode="SecureConversation"
        messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10">
        <secureConversationBootstrap authenticationMode="SspiNegotiated"
          messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10" />
        <localServiceSettings maxStatefulNegotiations="500" maxPendingSessions="500" />
      </security>
      <textMessageEncoding maxReadPoolSize="100" maxWritePoolSize="50" />
      <httpTransport maxReceivedMessageSize="2000000" allowCookies="true"
        maxBufferSize="2000000" />
    </binding>
  </customBinding>
4

0 回答 0