Partilhar via


ByteStream Encoder

This sample demonstrates how to create a ByteStreamHttpBinding, a Binding that demonstrates the functionality of the byte stream encoder.

Discussion

This sample demonstrates how to create a standard Binding using the standard binding elements ByteStreamMessageEncodingBindingElement and HttpTransportBindingElement. This sample shows how to use the byte stream encoder to upload and download an image. The byte stream encoder feature only supports the HTTP transport and it does not support features such as reliable messaging or security. The only MessageVersion supported is None.

Ee960169.Important(en-us,VS.100).gif Note:
If you are running this sample in Windows Vista or Windows°7 operating system, ensure that you are running Visual Studio 2010 with elevated privileges.

Ee960169.Important(en-us,VS.100).gif Note:
The samples may already be installed on your machine. Check for the following (default) directory before continuing.

<InstallDrive>:\WF_WCF_Samples

If this directory does not exist, go to Windows Communication Foundation (WCF) and Windows Workflow Foundation (WF) Samples for .NET Framework 4 to download all Windows Communication Foundation (WCF) and WF samples. This sample is located in the following directory.

<InstallDrive>:\WF_WCF_Samples\WF\Basic\Binding\ByteStreamEncoder

To set up, build, and run the sample

  1. Open the ByteStreamHttpBinding.sln file in Visual Studio 2010.

  2. Start a new instance of the ByteStreamHttpBindingServer project by right-clicking the project in the Solution Explorer and selecting Debug, and then Start new instance from the context menu.

  3. Start a new instance of the ByteStreamHttpBindingClient project by right-clicking the project in the Solution Explorer and selecting Debug, Start new instance from the context menu.