Monthly Archives: July 2006

Washing the SOAP from Messages

Now that the July CTP is public, I can divulge the details of a feature that I added to WCF in April.

In PDC ’05 we showed how you can use WCF extensibility to send “POX” (Plain Old Xml) Messages via our runtime. However, it took some magical incantations to enable. These including setting HttpMappingMode on the HttpTransportBindingElement, and writing a custom encoder that only writes out the body of the Message.

In July CTP, you now get 1st class support for POX-style Messages. To accomplish this, we added new Addressing and Envelope Versions (AddressingVersion.None and EnvelopeVersion.None). I’m also happy to report the obsolescence and removal of HttpMappingMode (nee MapAddressingHeadersToHttpHeaders for those former Beta 1 users who have been following along).

AddressingVersion.None means that your addressing information (To, Action, etc) is transmitted out of band from the Envelope. One example of this type of addressing is BasicHttpBinding — the <To> is sent as the HTTP Request-Uri, and the <Action> is sent out as either the SOAP-Action (in SOAP 1.1), or as a parameter to the content-type (in SOAP 1.2). If a particular binding requires WS-Addressing, then they can throw on Send() for Messages with AddressingVersion.None

EnvelopeVersion applies to the basic structure of the Message. This is where SOAP can come in to play. By default, the EnvelopeVersion of a Message is EnvelopeVersion.Soap12. SOAP 1.2 includes (among other things), support for Headers, and an outer <Envelope> tag. To “wash off” the SOAP from the Message (thanks Don), you should create a Message with EnvelopeVersion.None. When using such Messages, you cannot add any Headers other than <To> and <Action>. <To> and <Action> are “special” since they are intrinsics used by the runtime system. <To> is used by default for addressing dispatch, and <Action> is used by default for Operation dispatch. Some transports (such as our HTTP Transport) will strip these header values out and lift them into their “framing layer” (i.e. the goo we put around a Message to conform to the HTTP protocol).

For our programming model, AddressingVersion and EnvelopeVersion are packaged together into a single MessageVersion that is assigned to a Message or a Binding. Enabling simple POX messaging is now simply a matter of setting up an HTTP binding on your service with a TextEncoder that uses MessageVersion.None (or messageVersion=”none” in config-speak). Viola! No SOAP!

NOTE: see here for more information about the breaking changes between Beta 2 and the June CTP.

Transports Quotas

Nicholas has a great post explaining the various knobs available to be tweaked at the Transport layer. He also explains the post-RC0 changes we made to connection pool settings and throttling.

For developer settings, you shouldn’t need to touch the defaults, but for live deployments you will find these knobs quite useful. Our guidance on actual tuning is currently, uhm, thin but I’ve promised Christian that I’ll remedy that after I’ve beaten the last few WCF stress bugs into submission 🙂

Daily Show meets MSFT

Every year or so, the College Recruiting Team sets up a fun video about life on campus here in Redmond. This year, they got Ed Helms (of Daily Show fame) to provide an on-scene report. Check it out for some laughs.

I had some bonus fun watching Julie get interviewed by Ed, and catching a cameo of Aaron walking through the Red West hallways. Which puts my rough estimation of the filming date at last September or so (prior to Aaron’s ’round the world trip)….

The effect of IsOneWay on Operations

The other day I was asked “why should I use IsOneWay=true on my OperationContract? What does it actually do or optimize?”. In other words, what are the technical differences between:

[OperationContract]
void Send(MyMessage message);

and:
[OperationContract(IsOneWay=true)]
void Send(MyMessage message);

The first difference is semantics — even though you have a void method, if you don’t mark the Operation with IsOneWay then we will wait for an ACK/NACK reply. There are a few other behavioral changes when you choose IsOneWay:

  1. The service will release the connection (or complete the HTTP request/response by replying with null, etc) before dispatching to user code. If the operation is not marked with IsOneWay then our Dispatcher won’t reply until the Operation has completed
  2. ServiceModel Runtime will ask for IOutputChannel first, before falling back to IRequestChannel or IDuplexSessionChannel if IOutputChannel isn’t available. This allows the underlying stack to make optimizations on send/receive.
  3. Service Model Faults will not be returned, so Exceptions caused by the Message-level processing are not propagated to the client (though it’s still possible to receive a framing-level fault such as an HTTP status code error).

In general, you should have your methods represent their semantic usages. This will help your overall design and allow the system to know best how to adapt to your intended usage. So if you are writing a true one-way notification (or building upon one-way methods for a duplex contract), be sure to remember the IsOneWay=true annotation.

Thai Tom (Seattle, WA)

Rating:

When it comes to Thai food, we are severely spoiled here in Seattle. From downtown to the Sea-Tac airport, you are never far from solid Thai. Inevitably though, I am often asked "what’s the best Thai food in Seattle?". Given that the ambience and variety of cuisine varies broadly amongst the possible contenders, I have a hard time choosing just one. Thai Tom would be on my candidate list though, as it is among the most distinctive Thai restaurants in the area.

Thai TomWalking by it looks like another hole-in-the-wall ghetto quick-eat on "The Ave" in the center of the U-District (for some reason University Way is known as The Ave; I still don’t get it). Inside it is the Thai version of the movie Cocktail. On Wednesdays and Saturdays you’ll get to witness Tom gracefully manipulating 7 burners simultaneously. Tom and his off-night backup (known as "chef") are the centerpiece of this operation. And the best seats in the house are at the bar in full view of the inferno.

During the year, the line snakes out the door, and the wait can be over an hour for a table (and another 45min or so for your food). In those cases, I’ll call ahead for takeout — the time it takes for me to get to the U-District from work is just about right. In the summer however (off season for UW), you can regularly get a seat in less than 15 minutes. It’s been a few months since we’d been to Thai Tom, so we ordered two favorites. #10 (Japanese Eggplant), and #14 (Yellow Curry). The Yellow Curry at Thai Tom is unlike any other I’ve had, with no potatoes to be found.
Thai Tom

The Japanese Eggplant is mixed with ginger and chicken to create what is possibly my favorite dish on the menu.
Thai Tom

Speaking of favorite dishes, what is the best dish at Thai Tom? There is only one way to find out. I think it’s time for July Madness: a "Thai Tom Tournament". I’ve convinced LL to join me, and for posterity I’ll record the full range of choices on the menu (decoded from "#1"-"#16") in the faceoff below. A full one half of the menu will be virgin territory for me. Check back for updates as we make our way through the ~15 meals necessary to decide on an ultimate winner. Round 1 was tough (as we didn’t plan in advance and so began with two top seeds), but the edge went to #10.

Thai Tom Tournament

UPDATE (7/14/2006): While #7 (Sweet and Sour Chicken) was a tasty surprise, it wasn’t enough to best #16 (Panang Curry)

UPDATE (7/23/2006): #5 (Spicy Broccoli) has a nice taste of garlic, but #12 (their take on Pad See Iw) took this match.

UPDATE (8/13/2006): #4 (Thai Sauce Chicken) handily disposed of #13 (Poor Man’s Noodles), which was good for a few bites, but then a little boring overall.

UPDATE (10/22/2006): #6 was a decent mix of fresh vegetables and basil flavor, but I’m a sucker for garlic, and #9 (Garlic Pepper Chicken) was a runaway winner on flavor.

UPDATE (11/20/2006): Today was supposed to be #2 vs. #11, but they were out of wide rice noodles! We had to perform a quick swap of #3 for #2 (chart updated). This was the closest match since our opening meal, but the nod went to #3 (Cashew Chicken). I can still heartily endorse #11, a surprise contender of awesome peanut sauce atop vegetables and chicken.

UPDATE (12/07/2006): Again out of wide rice noodles, so another swap had #1 (Pad Thai) vs. #8 (Garlic Beansprouts). #8 is by far the worst dish at Thai Tom’s. Unless you adore beansprouts, stay away. I like bean sprouts well enough, but couldn’t eat more than a few bites. So #1 cruises to round 2 with a lucky draw. Thai Tom’s pad thai is quality, though I’m not much of a pad thai fan in general, and I forsee a round 2 exit for pad thai since it will be up against the fabulous #3…

UPDATE (01/13/2007): Went out in the snow to finish up the 1st round today 🙂 Wide rice noodles were in stock, so we were finally able to order #2 (their version of Pad Kee Mao). It was really really good, but I just couldn’t get enough of the peanut sauce in #15, the winner of this final match in round 1.

UPDATE (03/11/2007): Round 2 began with an upset of top-seeded #10, with Swimming Rama coming up tops.

UPDATE (04/11/2007): After a break for Passover, Panang Curry handly overran #4 (Thai Sauce Chicken).

UPDATE (04/17/2007): Cashew Chicken cruised to an easy win over the popular, but less exciting, Pad Thai.

UPDATE (04/24/2007): Completing round 2 was a close match between #9 and #12. At the end the garlic was king for Garlic Pepper Chicken.

UPDATE (05/02/2007): They were out of Panang Curry (next time I’m instituting a forfeit rule!). So it was a back-to-back Garlic Pepper Chicken appearance, but it was no match for Cashew Chicken.

UPDATE (05/12/2007): In the closest match yet, Panang Curry squeaked by Swimming Rama (probably #1 and #2 seeds in next year’s match :))

UPDATE (06/20/2007): The winner of the 2006-07 Thai Tom crown is….Panang Curry!

Thai Tom
4543 University Way NE
Seattle, WA 98105-4510
206-548-9548

Daily: 12:00AM-9:00PM (Lunch and Dinner)

Cross Country Dress Escort

LL and I were in New York this weekend, primarily to surprise my Mom and Paul for their 10 year anniversary. Also on the agenda were some dress fittings at Kleinfeld’s (yes, I have seen the dress already. If you’re superstitious, then pretend you didn’t read this). When all was said and done, the dress was freshly pressed and looked great but there was just one problem: the dress was still about 3000 miles away from Seattle.

After some stress due to mixed responses from Continental’s phone staff, we decided to take our chances and see if we could get the dress hung somewhere on the plane. Fortunately we had some very nice flight attendants who not only stored the dress in the 1st class closet, but also brought us some champagne mid-flight to celebrate our engagement 🙂

Us with champagne at 30,000 feet