Welcome to Windows Communication Foundation (WCF)
Top Tasks :

WCF Team Bloggers

Browse by Tags

All Tags » Technology   (RSS)

  • iPhone

    Just got an iPhone. Yes, it's all that. Amazing little device. My HTC "startrek" (aka cingular 3125) died a bizarre death (even reloading the ROM image of Win Mobile 5 didnt' help - must be some hardware issue). So this was the perfect opportunity to get me one of those little toys. It's hands down a better phone than any smartphone I've had before. The UI is intuitive, elegant, and chic. Most importantly, the web browsing experience is actually functional (the first time I've ever felt that about a phone). Of course, the biggest limitation is lack of ActiveSync support. This has been the single most useful feature of my smartphone - the ability to sync calendar and e-mail items over the air (and using "push" as opposed to having to manually or even automatically pull). There have been rumors for months about Apple licensing ActiveSync and delivering this functionality, but it hasn't happened yet. I bought mine hoping that it'll happen around the time Apple opens up the phone for developers (Feb 08). Read More...
  • A couple of weeks ago I posted about the "29,1" problem with the 4G iPod's and the Harman Kardon Drive+Play system. I finally found a FAQ on the web about this (it must be fairly new because neither google nor msn search hit this page last time I searched for it). This seems to be the best overall FAQ on the web for the HK D+P system... Read More...
  • Harman Kardon Drive+Play FAQ

    A couple of weeks ago I posted about the "29,1" problem with the 4G iPod's and the Harman Kardon Drive+Play system. I finally found a FAQ on the web about this (it must be fairly new because neither google nor msn search hit this page last time I searched for it). This seems to be the best overall FAQ on the web for the HK D+P system... Read More...
  • WCF Custom Channel Ecosystem

    Back in January, a few of us on the WCF team kicked off a side project dubbed "the channel ecosystem project". The goal is to create a community and an ecosystem around WCF custom channels. The first step was to make it easier for developers to build custom channels. To do this we decided to provide detailed documentation, samples, and a couple of tools. We've been creating this content over the last 3 - 4 months as a part-time effort next to our full-time jobs. Thanks to the hard work of many people, the content is now in a state where it can be shared with the world as a pre-release to solicit feedback. It's been published on windowscommunication.net . The samples are also linked from the samples gallery . We want to hear your feedback on this content as well as what else you'd like to see to help you build custom channels. Send feedback to ces at microsoft.com. Read More...
  • Moving lots of data

    Recently I've been getting lots of questions about moving large files (or lots of data) between a WCF service and client. The question comes in multiple forms, e.g. How do I send a file that's many GB in size from the service to the client? Should I use MTOM to send large files? I have a huge object graph and I want to send it over the wire, how should I do it? So let's explore the problems associated with moving lots of data and the solutions offered by WCF. Problem: Bandwidth Utilization Sending gigabytes of data means lots of bandwidth usage. While that may not be a problem if it happens infrequently on a 100 Mbit or 1 Gigabit LAN, it is definitely an issue when bandwidth is scarce and/or is being paid for. In interop scenarios, where messages are encoded as text XML, the encoding of binary data using Base64 exacerbates the problem because it inflates the size by 1/3. There are three solutions to this problem depending on your scenario. First, compression could really help especially if the data is text or gets encoded as text (using Base64). Compression/decompression can be implemented using a custom WCF encoder/decoder (and IIS 6 offers built-in response compression). Second, you can avoid using text encoding when interop is not required. WCF provides a binary encoding which is far more bandwidth-efficient than the text encoding especially when sending binary data. Third, if you want interop and you need to send large binary content, you can use MTOM which allows you to send the binary content outside of the SOAP envelope (as a separate part of a multi-part MIME message) without Base64 encoding it. Problem: Memory Utilization By default, WCF buffers messages to support protocols like WS-ReliableMessaging and WS-Security that require buffered messages. For extremely large messages this can lead to out-of-memory conditions especially on servers that try to send or receive multiple of those messages simultaneously. Fortunately, WCF supports streaming on HTTP, TCP, and Named Pipes allowing you to send infinitely large messages without hitting out-of-memory exceptions (actually, message size is constrained to Int64.MaxValue or 9,223,372,036,854,775,807 but hopefully that's infinite as far as your app is concerned). Problem: Recovering from Failures So what happens if half way through sending your 4GB stream the TCP connection fails? Well, your app must catch the exception and recover. If the other side has been processing the stream as it receives it (e.g. Read More...
  • Meet the Channel Model: ICommunicationObject

    A Common a State Machine Objects that deal with communication, e.g. sockets, usually present a state machine whose state transitions relate to allocating network resources, making or accepting connections, closing connections and aborting communication. The channel state machine provides a uniform model of the states of a communication object that abstracts the underlying implementation of that object. The interface provides a set of states, state transition methods, and state transition events. All channels, channel factories and channel listeners implement the channel state machine. ICommunicationObject ICommunicationObject is a CLR interface that describes the channel state machine contract: public interface ICommunicationObject : IDisposable { CommunicationState State { get; } event EventHandler Closed; event EventHandler Closing; event EventHandler Faulted; event EventHandler Opened; event EventHandler Opening; void Abort(); void Close(); void Close(TimeSpan timeout); IAsyncResult BeginClose(AsyncCallback callback, object state); IAsyncResult BeginClose(TimeSpan timeout, AsyncCallback callback, object state); void EndClose(IAsyncResult result); void Open(); void Open(TimeSpan timeout); IAsyncResult BeginOpen(AsyncCallback callback, object state); IAsyncResult BeginOpen(TimeSpan timeout, AsyncCallback callback, object state); void EndOpen(IAsyncResult result); } The events Closed, Closing, Faulted, Opened and Opening signal an external observer after a state transition occurs. The methods Abort, Close, and Open (and their async equivalents) cause state transitions. The state property returns the current state as defined by CommunicationState: public enum CommunicationState { Created, Opening, Opened, Closing, Closed, Faulted } An ICommunicationObject starts out in the Created state where it’s various properties can be configured. Once in the Opened state, the object is usable for sending and/or receiving messages but its properties are considered immutable. If an unrecoverable error occurs, the object transitions to the Faulted state where it can be inspected for information about the error and ultimately closed. When in the Closed state the object has essentially reached the end of the state machine. In general, once an object transitions from one state to the next, it does not go back to a previous state. States and Transition The figure below shows the ICommunicationObject states and state transitions. State transitions can be caused by calling one of Read More...
  • Dropped Calls with Vonage

    I've been suffering through an ever-increasing call-drop rate with my Vonage service for the last few months. It's gotten to the point where most calls over 10min will get disconnected. My best guess is that my uplink network characteristics (e.g. dropped packet rate) are interfering with the phone calls. My tale of woe is chronicled at the Vonage Forum so I won't belabor it again. Vonage tech support was (predictably) clueless but hopefully one of the VoIP experts on the internet forum will have some better ideas. One interesting tool I came by is on TestYourVoIP.com - it performs a 15sec VoIP call and analyzes the network characteristics. Looks like in my case, I get about a 2-4% packet discards rate. Not good. What's worse, it's a bursty loss as opposed to random loss, so that may explain my troubles - enough concentrated discarded packets and the call gets dropped. My next move may have to be to call Comcast. But if I can't make it better in the next couple of weeks, I may be forced to go back to Verizon (shudder to think). The moral of the story: most consumers faced with these kinds of problems wouldn't find Vonage (or any other VoIP service) stable enough to adopt in place of their local phone service. It's just beyond the abilities of a mere mortal to debug... Read More...
  • BMW + Bluetooth + iPod == Rightous, Dude!

    The Parrot CK3100 turns out to be perfect - supports voice calling, syncs the address book, kills the radio when you try to dial out or when you get a call - Sa-weet! The HK drive+play totally rocks - the UI is comfortable and very responsive, the display looks great, and the sound quality is sublime (the installer spliced it straight into the FM antenna so it's not using a transmitter). The knob on the left of the gear shift drives the iPod - it has the 4 buttons and you rotate it clockwise or counterclockwise to simulate the iPod's clickwheel. The display is clear and sleek - matches the Harman Kardon sound system that came with the BMW. To quote the Car Toys sales guy - "Rightous, dude"! (Total damage - $1300 - about $800 for the installation including all the brackets, $400 for the equipment, and $100 tax - totally worth it!) Read More...
  • No Bluetooth in 330ci After All

    Early last year I was enticed to buy a 330cic in large part because of all the cool gadget integration - the built-in bluetooth module, and the factory-installed iPod hookup . Well, both of those turned out to be a bust. I whined about the iPod integration in a previous post so I won't belabor it here. As far as cellphone integration, last year I was looking for the best of both worlds - a smartphone that would sync with outlook seamlessly (like the MPx220). Well, in December I finally gave in and got a nice black MOTO RAZR (yes, they are irresistable). But imagine my dismay at finding out that my 330cic didn't come with a BT module after all! In fact, it's the only model in the 3-series where the premium package does not include BT (and save for the M3, it's the highest-end 3-series you can get). Don't let the little handsfree button on the dash fool you - no circuitry behind that puppy. ARGH. The sales guy actually remembered selling me the car as having the built-in module, and he said he'd give me a good deal on installing it (what, not free?) but it turns out BMW doesn't even sell a BT package for the 33cic. Next move - Car Toys. They sell the Parrot CK3100 which looks like a great fit, and appears to be the best system (features / value) when you compare it to what's out there. They agreed to sell it for 2 bills, plus about 3 in installation == $500. Installation is a bear because the BMW has no usable empty space on the console, so they have to mount a bracket. While I'm at it, I'm also getting a Harman Kardon Drive + Play and improve my iPod car experience as well :-) Car Toys will sell that one for $199 (list) but the installation will be pretty pricy (order of $500) because they have to put in brackets for both pieces. Still, if it comes out nice, I'll be a happy guy :-) Read More...
  • WCF Architecture Overview

    This is a document I wrote a while ago and has been sitting around waiting to be published. Well, it finally is! Enjoy. Read More...
  • Looking for people who want to change the world

    We have a few open positions on the Indigo (WCF) team for people who want to change the world. In this role, you would get the opportunity to really change how millions of developers write distributed applications (if you're a distributed app developer yourself, you know that's a big part of your world!). I'm not exaggerating here, we're not just talking tweaks or incremental improvements, I really mean significant change. We're looking for program managers to help innovate, design, build and ship Indigo v1 and future versions/technologies in the distributed applications space. We have positions for both experienced folks and recent college grads. If you or someone you know is interested, just email me at yassers@microsoft.com . Read More...
  • Meet the WCF Channel Model – Part 2

    Most WCF developers won’t interact directly with channels or have to think about them much. The Service Model, WCF’s programming model, provides abstractions that layer on top of channels to give a “method and typed parameters” programming model. However, many developers will want to write custom channels for the reasons I mentioned in my previous post . For those developers, it’s interesting to understand how the channels are used (indirectly) by a developer building a WCF service and/or client. WCF services and clients are based on the concept of endpoints. An endpoint consists of an address, a binding and a contract. The address is the endpoint’s network location (the where). The binding specifies how the endpoint communicates with the world (the how) and the contract is the collection of operations the endpoint exposes (the what). For the purpose of this discussion, the binding is the most interesting of the three. A service developer defines an endpoint by specifying its three components. For example: public static void Main() { ServiceHost host = new ServiceHost(typeof(StreamServer)); host.AddEndpoint( typeof(IStreamService), new ChunkingTcpBinding(), new Uri("net.tcp://localhost/StreamService")); host.Open(); Console.WriteLine("stream server started...."); Console.ReadLine(); } The call to host.AddEndpoint defines the endpoint. The call to host.Open creates the channel stack that will listen for and process messages targeted at the endpoint. Each binding is really a collection of binding elements each contributing to building the channel stack. For example, this is the ChunkingTcpBinding: public class ChunkingTcpBinding : Binding { public ChunkingTcpBinding() { ... } public override BindingElementCollection CreateBindingElements() { BindingElementCollection col = new BindingElementCollection(); ChunkingBindingElement cbe = new ChunkingBindingElement(); TcpTransportBindingElement tcp = new TcpTransportBindingElement(); tcp.TransferMode = TransferMode.Buffered; tcp.MaxMessageSize = Int32.MaxValue; col.Add(cbe); col.Add(tcp); return col.Clone(); } } Each binding element inherits from BindingElement which has a couple of interesting methods: public abstract class BindingElement { public virtual IChannelListener<TChannel> BuildChannelListener<TChannel>(ChannelBuildContext context) where TChannel : class, IChannel { } public virtual IChannelFactory<TChannel> BuildChannelFactory<TChannel>(ChannelBuildContext context) { } ... other methods Read More...
  • Meet the WCF Channel Model - Part 1

    For the past 5 months or so, I’ve been working on the WCF Core Communications team (with Kenny , Matt , and Steve ) where we focus on WCF transports and hosting features. In this period, I’ve learned a lot about the WCF channel model and I’m still learning a lot. I want to share some of what I’ve learned with you on this blog. So here’s a first of what I hope to be many posts on this topic. Kenny also has several posts about this subject on his blog . The WCF runtime consists of two layers: The channel stack and the dispatcher/proxy. The channel stack is responsible for sending/receiving messages between the sender and receiver while the dispatcher/proxy layer is responsible for translating those messages to/from service method calls. The channel stack is where WCF gets a lot of its power and versatility. It’s similar to the traditional OSI model in that there are cleanly separated layers with each layer using the services of, and only calling on, the next layer down. It’s also very different from the OSI model in that there aren’t n well defined layers each with their specific role. Instead, there are two types of channels with implementations of these types allowed to compose in different ways depending on the application’s needs. At the bottom of the stack is a transport adapter channel (aka a transport) whose role is to adapt an underlying transport to WCF’s channel model. For example, WCF ships with HTTP, TCP, Named Pipes, Peer to Peer, and MSMQ transport adapters allowing you to use any of these technologies as a means of transporting messages between sender and receiver. Each transport adapter can use an encoder that transforms WCF messages to the appropriate format for the transport. WCF ships with three encoders: text XML, binary XML, and MTOM. You can mix and match transport adapters and encoders unless the transport adapter has some restriction on the type of encoder it needs. Above the transport adapter is zero or more protocol channels. These are channels that perform some kind of message transformation as a means of communicating with the equivalent protocol channel on the other side. For example, WCF ships with security, reliable messaging, and transaction flow channels. Each of these channels add/read headers to/from the message and some of them modify message content and even send their own messages (reliable messaging sends ACK messages). One of the key differences between WCF and existing distributed app technologies like ASMX or ES, is this Read More...
  • Joshua said : Personally, I wonder if people will even bother with local storage in the future, though. It's amazing how cheap and reliable the bandwidth is getting. At 800MB-1.2GB per full length move (home theater quality DivX), you can be watching two different movies at different places in the house, watching something on-demand on comcast, and talking on the phone (you finally convinced me to switch); all wireless, with no degradation of quality. I could easily see security companied piping all video to the central monitoring station, for example, and only have local storage for a temporary buffer in case of network outage. Joshua, congrats on going VoIP :-) Your point about no local storage in the future is an interesting one. Are you saying that bandwidth is good enough that you can rely on streaming media instead of storing everything locally? I certainly see the beginnings of this - e.g. my former manager and buddy Robert is now using a Rhapsody playlist as one of the feeds to his Sonos system (which, by the way, I saw today, and is way cool). He doesn't really care anymore about the fact that he also has 600 cd's ripped on his local drive - he basically gets everything he needs from the Rhapsody feed for $10/month. I guess I'm a little more old-fashioned - I like my music to be within reach at all times. So I think I will continue to keep local backups of all my media on mass storage. I am also a little less sure than you are about being able to have enough bandwidth going in and out of the house for a full remotely-generated digital experience for a few years to come - of all the exponential growth curves in our industry (compute power, memory, disk, etc), bandwidth has been the slowest one). As Jim Gray likes to say, the cheapest (and usually fastest) way to send a Gig of data to someone is in a FedEx envelope. But one thing's for sure, you're absolutely right that the day of the CD or DVD backup are long gone... Read More...
  • My New Casio Exilim...

    My old digtal camera, a Nikon Coolpix 350, stopped working while I was in China a couple of months ago, so I've been wanted to get a new digital camera. I just the Casio EXZ750 (Exilim 7.2Mp) at costco for $400. It's one of the most beautiful cameras I've seen on the market - slim, huge (3") viewer, nice UI, and super-fast boot and shutter speeds (at least compared to that old dog, the Coolpix). So far, highly recommended - it even meets Sheri's approval, and she's been a very reluctant adopter of digital cameras in the past. Those costco trips are dangerous - you go in to by some diapers, you end up spending hundreds of dollars on things you didn't realize you absolutely needed before you got in the store :-) Read More...
More Posts Next page »

Copyright © 2006 Microsoft Corporation. All Rights Reserved. | Terms of Use | Privacy Statement | Contact Us