You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create a Windows
Communication Foundation (WCF) Data Services service. The service connects to a Microsoft SQL
Server 2008 database. The service is hosted by an Internet Information Services (IIS) 6.0 Web server.
The application works correctly in the development environment. However, when you connect to
the service on the production server, attempting to update or delete an entity results in an error.
You need to ensure that you can update and delete entities on the production server. What should
you do?
A.
Add the following line of code to the InitializeService method of the service.
config.SetEntitySetAccessRule (“*”,EntitySetRights.WriteDelete |
EntitySetRights.WriteInsert);
B.
Add the following line of code to the InitializeService method of the service.
config.SetEntitySetAccessRule (“*”,EntitySetRights.WriteDelete |
EntitySetRights.WriteMerge);
C.
Configure IIS to allow the PUT and DELETE verbs for the .svc Application Extension.
D.
Configure IIS to allow the POST and DELETE verbs for the .svc Application Extension.
Explanation:
An OData client accesses data provided by an OData service using standard HTTP. The OData
protocol largely follows the conventions defined by REST, which define how HTTP verbs are used.
The most important of these verbs are:
GET: Reads data from one or more entities.
PUT: Updates an existing entity, replacing all of its properties.
MERGE: Updates an existing entity, but replaces only specified properties[2].
POST: Creates a new entity.
DELETE: Removes an entity.
Http Header Verbs Enumeration
(http://msdn.microsoft.com/en-us/library/windows/desktop/aa364664(v=vs.85).aspx)
WCF Data Services Overview
(http://msdn.microsoft.com/en-us/library/cc668794.aspx)
Introduction to OData Protocol
(http://msdn.microsoft.com/en-us/data/hh237663)