locked
MessageInspector or Orperation Behavior RRS feed

  • Question

  • User-221752185 posted

    Trying to understand really when to the OperationBehavior. My scenario... The client needs to send a timestamp in a message header to my WCF. The WCF needs to validate that the timestamp is valid and no more than 30 mins out of bounds to the server time. Rather then checking and duplicating code on each operation, I'd rather just write it once. I was thinking to use OpertaionBehavior, but then MessageInspector looks at the message... Im a bit confused.

    Tuesday, April 2, 2013 7:38 AM

Answers

  • User220959680 posted

    MessageInspector

    A message inspector is an extensibility object that can be used in the service model's client runtime and dispatch runtime programmatically or through configuration and that can inspect and alter messages after they are received or before they are sent. MSDN Reference

    OperationBehavior

    Specifies the local execution behavior of a service method. MSDN ref

    The WCF needs to validate that the timestamp is valid and no more than 30 mins out of bounds to the server time.

    As suggested above this can be achieved through Timeout property, which is configurable through Web.config

    http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/84551e45-19a2-4d0d-bcc0-516a4041943d/

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, April 2, 2013 9:53 AM

All replies