Streaming Photo OData Service Sample

This sample demonstrates how to use WCF Data Services to implement an OData service that uses a streaming provider to store and retrieve image files, along with information about each photo. It includes a client application that enables you to consume and upload new photos.

C# (124.8 KB)
 
 
 
 
 
4.6 Star
(13)
20,508 times
Add to favorites
10/18/2011
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • Server Error in '/' Application. The resource cannot be found.
    1 Posts | Last post October 18, 2016
    • Hi, when i try to run this link: http://localhost:55963/PhotoService/PhotoData.svc i recive the following message:
      
      Server Error in '/' Application.
      The resource cannot be found.
      Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly.
      
      Requested URL: /PhotoService/PhotoData.svc
      
      Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1586.0 
      
      i have IIS express.
      the PhotoService is running
      
      http://localhost:55963/PhotoData.svc/
      
      <?xml version="1.0" encoding="UTF-8" standalone="true"?>
      <service xmlns="http://www.w3.org/2007/app" xmlns:app="http://www.w3.org/2007/app" xmlns:atom="http://www.w3.org/2005/Atom" xml:base="http://localhost:55963/PhotoData.svc/">
      <workspace>
      <atom:title>Default</atom:title>
      <collection href="PhotoInfo">
      <atom:title>PhotoInfo</atom:title>
      </collection>
      </workspace>
      </service>
      
      Please your Help 
  • Got bad request !
    1 Posts | Last post June 02, 2016
    • I've downloaded it just doesn't work at all ! status 400 bad request ! i even redownloaded it but doesn't help ..
  • Bad Request when adding photo in VS2013 U4
    1 Posts | Last post August 07, 2015
    • I've downloaded and run this sample and when I try to add a picture, it returns with bad request , status 400. 
      
      I'm trying to do something similar in my own project, but despite having hasstream, and an existing entry in the database that shows that the edit-media link is in the metadata, when I try to add an entry I get an error in the client saying that there are no edit-media links and it aborts.
      
      My approach would be to modify this photo project or get my own wcf odata service to work based on this.. but neither will work at the moment :(
      
      Could this sample be updated so that it works with the latest versions of IDE + frameworks?
  • Errors occur when adding or changing the image & save
    5 Posts | Last post May 04, 2015
    • When I run client application, I try to add or change the image and save it, following errors occur(I'm using windows XP to run this sample).
      You do not have permission to view this directory or page using the credentials you supplied (access denied due to Access Control Lists). Ask the Web server's administrator to give you access to D:\VS2010_Service\OData\Streaming_Photo_OData_Service_Sample\C#\PhotoService\PhotoData.svc'
      
      I have already grant the modify access right of "D:\VS2010_Service\OData\Streaming_Photo_OData_Service_Sample\C#\PhotoService\" to both NETWORK SERVICE & ASPNET user.
      
      Any suggestion will be appreciate.
    • I've seen this in some instances. Have you already tried granting full permissions on the PhotoData.svc file explicitly to the account under which IIS runs?
    • I checked the PhotoData.svc file, both NETWORK SERVICE & ASPNET user have the full control permission to it.
    • I tried this sample again on vista, no this problem.
    • I hava the same Issue On IIS express。do you hava a way to catch this exception when it happened
  • What must be changed in Web.config to use SQL Server instead of SQLExpress
    4 Posts | Last post November 08, 2013
    • I am using SQL Server 2012 instead of SQLExpress. What in Web.config must be changed to use SQL Server?
      
      Thank you.
    • You should only need to change the <b>Data Source</b> parameter in the connection string to point at your SQL Server instance instead of <em>localhost\SQLExpress</em>: Data Source=<my_instance_name> 
    • Glenn,
      
      I'm still confused.
      
      The web.config file currently contains the following:
      <connectionStrings>
        <add providerName="System.Data.EntityClient"                                                   
         connectionString=
            "metadata=res://*/PhotoData.csdl|res://*/PhotoData.ssdl|res://*/PhotoData.msl;
         provider=System.Data.SqlClient; 
         provider connection string='Data Source=localhost\SQLExpress;
         Initial Catalog=PhotoStorage;
         Integrated Security=True;
         MultipleActiveResultSets=True'" 
         name="PhotoDataContainer"/>
      </connectionStrings>
      
      Are you saying that I should change it to:
      
      <connectionStrings>
        <add providerName="System.Data.EntityClient"                                                   
         connectionString=
            "metadata=res://*/PhotoData.csdl|res://*/PhotoData.ssdl|res://*/PhotoData.msl;
         provider=System.Data.SqlClient; 
         provider connection string='Data Source=my_instance_name;
         Initial Catalog=PhotoStorage;
         Integrated Security=True;
         MultipleActiveResultSets=True'" 
         name="PhotoDataContainer"/>
      </connectionStrings>
      
      Thanks for your help.
    • Yes, where my_instance_name is the SQL Server instance hosting your database.
      
  • Failure executing service on non-english windows OS?
    4 Posts | Last post September 18, 2012
    • Running the Sample, Step 2 works, then
      Step 3 fails with Error 500.
      
      When I switch on detailed error messages in web.config and start the client, the client shows HTTP error 500, 
      
      <message xml:lang="de-AT">An error occured while processing this request.<message>
      
      Does the software not run on foreign versions of Windows OS?
      (securit/credential enums, directory names, ... all must be globalized)
    • see part1 for a solution 
      http://blogs.msdn.com/b/astoriateam/archive/2010/08/04/data-services-streaming-provider-series-implementing-a-streaming-provider-part-1.aspx#comments
      
    • The data service should be language agnostic. Based on your description, it looks like the service is having trouble accessing the database. Make sure that the Network Service account has read and write access to your database.
    • How to resolve "An error occurred while processing this request"
      
      1. Open IIS Manager
      2. Click on Application Pools
      3. Click on the ASP.NET v4.0
      4. Click on Advanced Settings...
      5. Change Identity from "ApplicationPoolIdentity" to NetworkService
      
      Answer Courtesy of m3gabyte
      
  • Using this sample for WCF Data Services with EF 4.3 code first
    1 Posts | Last post August 02, 2012
    • Hi,
      I'm trying to apply your sample for WCF Data Service with EF 4.3 code first. I've already applied [HasStream] attribute for my entity, but when I browse the  entity set (http://server/service.svc/Photos) I get the 503 http code.
      
      Please help if I missed something
  • Could you pls supply a step-by-step recipe for setting the security issues?
    1 Posts | Last post March 22, 2012
    • I'm a dev, not an admin. Sorry about this. I need help in how to make the stream provider work with IIS and the DB.
      For example, how do I find out the account IIS is running in?
      
      thx herbert