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 the box. With the components that ship in the box, you can read and write XML 1.0 documents plus the binary XML format that we include as well. All of this support is through classes for defining XML readers and writers. You can define your own readers and writers with this model. For example, it should be possible to build a message implementation that supports XML 1.1 documents, although I have never tried this to see if it would work. You can even work with documents that are not recognizable as XML in any form using the same approach as long as there is some way to project that external document to an XML InfoSet temporarily during message processing.
Next time: Security and Streaming
Comments
Anonymous
August 15, 2007
Let's say I wanted to send JSON, what classes would I have to extend and plug in to WCF to make that work? In 3.0, not 3.5. Would I have to write a JsonWriter class that extends XmlDictionaryWriter? How would I insert that class into the framework so that it uses that particular class for all serialization? Thanks, JasonAnonymous
August 15, 2007
I've got a sessionful contract that I want to use with HTTP. How do I get the HTTP transport to produceAnonymous
August 15, 2007
Hi Jason, A MessageEncoder is the standard mechanism used to introduce new readers and writers. The encoder produces Message instances that use your readers. The implementation is probably a bit easier if you also introduce a custom message formatter. A formatter performs the translation from the messages to CLR types.Anonymous
August 16, 2007
Great! Thanks! I'll start looking there.