Welcome to MSDN Blogs Sign in | Join | Help

Browse by Tags

All Tags » Messages » Answers   (RSS)

You Are Here

Inside of a service method, how do I know where the message was delivered? Without defining what distinguishes a location it's hard to explain where 'here' is. I've got a few guesses though based on the most common variations of this question: OperationContext.Current.IncomingMessageHeaders.To

Quotas for Copying Messages

Is it possible to copy a very large message? The CreateBufferedCopy method of Message requires a quota parameter that is only integer sized. There has always been a direct way around the problem of copying messages, which is that any message allows you
Posted by Nicholas Allen | 1 Comments
Filed under: , ,

Producing Typed Messages

How do typed messages get created from an object that has a message contract? There seem to be a lot of examples that talk about how messages get produced when they're described by data contracts but relatively few descriptions of the equivalent process

Reading Messages for Validation

How do I perform XML validation against an entire message? There is a method to read the body of the message but it's only possible to read headers one at a time. Although it sounds more complicated than it really is, a straightforward way to read an
Posted by Nicholas Allen | 2 Comments
Filed under: , ,

Not Omitting the XML Declaration

Why doesn't a message start with an XML declaration? The XML declaration is a processing instruction at the beginning of an XML document that gives information about the format and logical structure of the document. You've probably seen the most commonly

Basing Authorization on the Message Body

How do I use a field in the message to answer an authorization request in ServiceAuthorizationManager? There are two ways to go about doing this. The first makes use of a new feature in Orcas while the other is potentially more flexible and definitely

Printing Flexible Message Headers

When a message header supports multiple representations, which version is used when the message header is printed? A message header is a piece of data about the message that's carried on the wire somewhere apart from the message contents. When using an
Posted by Nicholas Allen | 1 Comments
Filed under: , ,

Body is a Stream

I've answered this question before but it continues to keep being asked so I'll answer it again. This comes up most often when someone is trying to log messages, either through the official message logging feature or on their own by calling ToString.
Posted by Nicholas Allen | 5 Comments
Filed under: , ,

XML Support

What kinds of XML do messages support? This isn't a simple question because, like many parts of a framework, it's important to distinguish what could possibly be done given enough time versus what could easily be done given the components that ship in
Posted by Nicholas Allen | 4 Comments
Filed under: , ,

Message Disposal

My service operation has an untyped contract and I'm trying to save the messages that it receives for processing later. However, the messages always say that they are closed before I can read them. Why are the messages closed? Messages are good for a

Data Contract and Message Contract

I have an existing web service that I need to replace with a WCF web service. How do I choose between using a data contract and a message contract? There are actually three choices to consider for describing the messages that your service uses: data contracts,

Reader Quotas with Untyped Messages

I have an operation contract that uses untyped messages. When using the message, I get an error telling me to change the quota settings on the XmlReader. Where are these quotas located? I'm not using an XmlReader. A message represents an XML InfoSet.

Just the Headers

How do I change the HTTP status code of the response that is sent back when using a one-way contract? The result of using a one-way contract is to automatically send back an empty HTTP response when the service method is called. Sending back this response
Posted by Nicholas Allen | 6 Comments
Filed under: , , ,

Choosing a Message Size for Buffered Copies

Creating a copy of a message requires passing the "maximum buffer size" to CreateBufferedCopy. How big should I make this maximum buffer size? In most cases, you can use Int.MaxValue and not worry about the buffer size. Specifying this buffer size is
Posted by Nicholas Allen | 1 Comments
Filed under: , ,

Extracting Content Types

What is the content type of the message returned by a service? The idea of a content MIME type is very popular in HTTP programming, both for communicating the format of the data and the text encoding inside that format. However, content types are not
Posted by Nicholas Allen | 1 Comments
Filed under: , ,
More Posts Next page »
 
Page view tracker