3

There is a localization mechanism in WCF that enables one to localize faults returned to client, via a FaultReasonText object that's a part of the fault.

The way this is done is that you pass all possible translations of the fault's message inside a collection in the FaultReasonText. This, I understand, is based on SOAP v1.2.

Does anyone actually use this mechanism? Isn't this wasteful in terms of bandwidth? Why would you send all possible translations to a client that is (probably) only interested in a specific language?

urig
  • 16,016
  • 26
  • 115
  • 184
  • Not so wastefull as faults should not happen THAT often.... that said, I know of noone. Lets see who answers ;) – TomTom Mar 18 '10 at 10:24
  • Hi TomTom. I'm actually thinking of somehow extending this to regular responses as a means to providing localized content from my server. I guess in this context the waste is more relevant. – urig Mar 18 '10 at 10:56
  • Also wonder why the constructor of FaultException allows you to specify a FaultReason when the reason should be contained in the TDetail object itself one would think. Or why there are no public constants defined for standard FaultCode names and namespaces. – luksan Jun 03 '10 at 02:22

1 Answers1

1

FaultReason Class allows to store multiple translations if it's needed, e.g to cache possible fault descriptions in different languages.

However normally constructor FaultReason(FaultReasonText) will be used to Initialize a new instance of the FaultReason class using the specified text element that describes the fault in a specific language.

Michael Freidgeim
  • 26,542
  • 16
  • 152
  • 170