Archive

Archive for August, 2008

Sending and receiving JSON messages from a WCF Service

August 27th, 2008

Here is a sample project which will show you how to send and receive JSON data from a WCF service using three of the most popular javascript libraries.  You can do it without the libraries but why reinvent the wheel.  Also, this is actually a VS2008 Studio Template so just download and drop the file into My Documents\Visual Studio 2008\Templates\ProjectTemplates\Visual C#\ and enjoy.

To use the template, goto File\New Project\Visual C# and look to “My Templates” and you should see WCF JSON.

wcf-json Visual Studio 2008 Template

Programming , , ,

WCF and Large File Transfers

August 22nd, 2008

I’ve been doing a bit of WCF lately and picked up on a few things that will be helpful for me to remember.  To speed large transfers switch the messageEncoding on the binding to be MTOM, otherwise your data will get base64 encoded inside the XML.

  1. Streaming requires a MessageContract and not a DataContract
  2. Streaming doesn’t work on wsHTTPbinding.
  3. A MessageContract can only have one Member in the body (stream).

Another good piece:
http://www.aspfree.com/c/a/Windows-Scripting/WCF-and-Hosting/3/

Programming , , ,

Missing “Open from SourceSafe” in Visual Studio 2008

August 18th, 2008

When you install visual studio 2008 along side Visual Source Safe 2005 you will need this update to enable the Open from Source Safe option from within visual studio.

http://msdn.microsoft.com/en-us/library/ms181038(VS.80).aspx

Programming, Tips and Tricks ,