Ignoring MustUnderstand

How can I configure a client or server to handle messages even if a required header isn’t understood? The SOAP mustUnderstand attribute on a header is used to indicate that processing the header is required in order to properly handle the message. If the header can’t be processed, then a fault is supposed to be…


Untyped Asynchronous Calls

How do I asynchronously call a service operation without having a typed service contract on the client? An untyped contract is one where there is a single input or output parameter of type Message. Using the Message class rather than strong types allows you to reuse the same contract for any arbitrary message format. To…


Customizing Parameter Names

Why does changing the name of a parameter in a service contract break compatibility with existing clients? Each named part of the message that appears in metadata or as part of the wire protocol needs to come up with a name from somewhere. We don’t have any better default name for parameters than the name…


Don’t Check What Doesn’t Have to be Correct

I’m trying to validate the structure of messages against schema but there are SOAP headers that I don’t recognize. How do I check that these headers are correct? SOAP headers already have a mechanism for saying whether you are required to deal with that header. The mustUnderstand attribute with a value of true means that…


Order Best Practices

Why is setting the Order property on data members recommended when adding fields in a new version of the contract? The data contract versioning best practices recommend taking three steps when adding fields in a new version of a contract. The first recommendation is to set the IsRequired property on the new field to false….


Nothing to See Here

What is the System.ServiceModel.Channels.NullMessage used for? The Message class is a central abstraction for representing communication between two endpoints. There’s often interesting information associated with a message, such as the message delivery properties, and that interesting information hangs off of the Message class. Therefore, if you don’t have a Message, then you don’t have access…


Levels of Tracing, Part 6

The last article in the levels of tracing series covers the logging of messages at the transport level. Transport level logging generally occurs in the message encoder as that is where the message bytes are actually processed but in some rare cases there are times when the transport sends messages without using a message encoder….


Levels of Tracing, Part 5

Last time I talked about the four switches that control which types of messages get logged: logEntireMessage: whether to log message bodies or just the headers of each message logMalformedMessages: whether to log the message when there is a decoding error, such as in a message encoder or serializer logMessagesAtServiceLevel: whether to log messages when…


Levels of Tracing, Part 4

Today’s article continues the series on tracing and message logging with a look at the different message logging configuration options. Introduction to tracing and trace levels Configuration tracing and trace options Enabling message logging The options I showed yesterday for message logging included four switches to control which types of messages get logged and two…


Levels of Tracing, Part 3

Although often associated with event tracing, message logging is actually a separate facility from the standard levels of tracing. Message logging is not enabled by default just like event tracing is not enabled by default. You activate message logging by adding a trace source and listener to the configuration file as we saw last time….