As promised in the last session of this year’s TechEd Europe which I had today on WCF Data Services, here you find the complete demo-code for download.

Click here to get to the session demo-downloads.

Please consider the following notes to make the demos working on your machine.

  • You need SQL Server (or SQL Server Express).
  • If you use SQL Server Express, you need to modify the connection strings in the backend to point to (local)\SQLEXPRESS.
  • Next execute GenerateDatabase.sql to create the database using SQL Server Management Studio.
  • Finally add the physical directory <parent>\OdataSessionsBackend as http://localhost/OdataSessionsBackend to your IIS-installation.
  • For the Windows Phone demo app you need the Windows Phone developer tools installed.

Note that I’ve used the users test1 and test2 both having the password pass@word1 set in the membership-database. Also note that for streaming large files I required to modify the web.config of the backend to allow large uploads for the WCF binding and at the same time to allow large uploads for the web-runtime in the ASP.NET settings:

  <system.web>

    <httpRuntime maxRequestLength="10000000"/>
   
    <roleManager enabled="true" />
    <authentication mode="Forms" />
   
    <compilation debug="true" targetFramework="4.0">
      <assemblies>
        <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
      </assemblies>
    </compilation>
  </system.web>
  <system.serviceModel>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
    <services>
      <service name="OdataSessionsBackend.ManageSessionsService">
        <endpoint binding="webHttpBinding"
                  bindingConfiguration="ManageSessionServiceBinding"
                  contract="System.Data.Services.IRequestHandler" />
      </service>
    </services>
    <bindings>
      <webHttpBinding>
        <binding name="ManageSessionServiceBinding"
                 maxReceivedMessageSize="500000000"
                 maxBufferSize="500000000"
                 transferMode="Streamed">
        </binding>
      </webHttpBinding>
    </bindings>
  </system.serviceModel>
Feel free to get in touch with me if you have any further questionsWinking smile