我正在尝试使用unity返回自定义错误异常 但是在Rst \ Issue操作期间我收到以下错误:
[服务跟踪查看器例外] [1]
图片:[1]:http://i.stack.imgur.com/oAxGT.png
我使用的是一个实际上类似于wsHttpBinding的custmBinding。 这里我在wcf方法中手动抛出异常,以测试行为。
当我注释掉throw new exception语句时,该服务正常工作并返回预期的结果。但该服务目前无法处理异常。 那么为什么服务在发生异常时无法保护传出消息?
EDIT(BindingConfig):
<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>