最简单的WCF-REST服务-世界上最简单的问题

最简单的WCF-REST服务-世界上最简单的问题

问题描述:

很抱歉,这很简单.尝试构建世界上最简单的REST服务.但是在看了几个小时的复杂示例之后,我无法使它正常工作.

I apologize if this is simple.  Trying to build simplest REST service in the world.  But after a few hours of looking at complex examples, I cannot get it to work. 

我想要的是:要将以下URL输入浏览器,并以JSON格式返回给我,请在浏览器中输入以下字符串:

What I want:  To enter the following URL into a browser, and have it return to me in JSON format the following string in the browser:


"Service Reply at: " + DateTime.Now.ToShortTimeString();

您没有配置服务端点,因此,默认情况下,WCF将使用basicHttpBinding托管您的服务.您必须添加一个端点并将其配置为使用webHttpBinding.

You don't have a service endpoint configured, so by default, WCF will host your service using the basicHttpBinding. You have to add an endpoint and configure it to use the webHttpBinding.

此致,
彼得

Regards,
Pieter