Database Reference
In-Depth Information
Rename your project from the default to OECDWebSvc, then click OK.
In Solution Explorer, Right-click the IService1.cs file and delete it; then
right-click Service1.svc and rename it to OECD.svc .
You can see what the project should look like in Figure 9-8.
FIguRe 9-8 Solution overview
Replace the content of OECD.svc with the following code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using System.ServiceModel.Activation;
namespace OECDWebSvc
{
[ServiceContract(Namespace = "OECDSvc")]
[AspNetCompatibilityRequirements(RequirementsMode =
AspNetCompatibilityRequirementsMode.Allowed)]
public class OECD
{
[DataContract(Namespace = "OECDSvc")]
public class Response
{
[DataMember]
public string tmString { get; set; }
}
[OperationContract]
[WebInvoke(BodyStyle = WebMessageBodyStyle.Wrapped,
RequestFormat = WebMessageFormat.Json, ResponseFormat =
WebMessageFormat.Json)]
public Response POSTTreemapByRegions(String sRegions)
{
Search WWH ::




Custom Search