How to Throw Typed Fault Exceptions From Orchestrations Published as WCF Services Revisited

A couple of you experienced the following error:

“Digest verification failed for Reference '#_0'”

when using my component with the following configuration:

Adapter: WCF-Custom
Binding: WsHttpBinding or NetTcpBinding
Security: Message
ClientCredentialType: Windows

So I decided to reopen the project and look into this problem. I made some researches on MSDN finally I decided to change approach. Hence I made the following changes:

  • I replaced the custom endpoint behavior with a custom service behavior.
  • I substituted the MessageInspector component with a custom class which implements the IErrorHandler interface. This implementation is more appropriate to create a custom typed fault.

I successfully tested the new component using 3 different kinds of WCF Receive Locations:

Scenario 1

  • Adapter: WCF-CustomIsolated
  • Binding: WsHttpBinding
  • Security Mode: None
  • ClientCredentialType: N/A

Scenario 2

  • Adapter: WCF-CustomIsolated
  • Binding: WsHttpBinding
  • Security Mode: Transport
  • ClientCredentialType: Windows

Scenario 3

  • Adapter: WCF-Custom
  • Binding: NetTcpBinding
  • Security Mode: Message
  • ClientCredentialType: Windows

Finally, I refreshed the content of the this my post to reflect the new implementation and uploaded the code of the version here. In order to use the new component, you need to accomplish the following steps:

  • read the article to understand the differences and characteristics of the new implementation.
  • properly register the FQDN of the new ErrorHandler assembly in the machine.config.
  • Reconfigure your Receive Location to use the new custom service behavior instead of the previous custom endpoint behavior.