惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

The Last Watchdog
The Last Watchdog
Microsoft Security Blog
Microsoft Security Blog
宝玉的分享
宝玉的分享
小众软件
小众软件
雷峰网
雷峰网
F
Full Disclosure
B
Blog
Hugging Face - Blog
Hugging Face - Blog
GbyAI
GbyAI
月光博客
月光博客
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
TaoSecurity Blog
TaoSecurity Blog
博客园 - 聂微东
P
Palo Alto Networks Blog
N
Netflix TechBlog - Medium
S
Secure Thoughts
Google Online Security Blog
Google Online Security Blog
P
Privacy & Cybersecurity Law Blog
U
Unit 42
Cloudbric
Cloudbric
Know Your Adversary
Know Your Adversary
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Vercel News
Vercel News
博客园 - Franky
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
N
News and Events Feed by Topic
T
Tailwind CSS Blog
S
Schneier on Security
IT之家
IT之家
P
Proofpoint News Feed
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
Tenable Blog
Google DeepMind News
Google DeepMind News
The GitHub Blog
The GitHub Blog
T
Troy Hunt's Blog
V2EX - 技术
V2EX - 技术
Cyberwarzone
Cyberwarzone
P
Privacy International News Feed
I
InfoQ
MongoDB | Blog
MongoDB | Blog
Project Zero
Project Zero
B
Blog RSS Feed
Help Net Security
Help Net Security
H
Heimdal Security Blog
有赞技术团队
有赞技术团队
The Register - Security
The Register - Security
V
V2EX
C
CXSECURITY Database RSS Feed - CXSecurity.com
J
Java Code Geeks

博客园 - 雷明

Ado.Net读取Excel常见问题总结 Win7 安装.net framework 4.0 失败,错误HRESULT 0xc8000222解决办法 Excel中删除链接 ipad 3.2.2 IPAD 越狱教程 ASP.NET 链接 Access 数据库路径问题最终解决方案 代理上网后localhost使用不了,只能使用127.0.0.1解决 Windows API函数大全 一个技术转销售人员的感悟--深刻(转) 两个Excel表联动 orcale数据库的导入导出 ORACLE 创建表空间 销售七字真诀 十年创业的一封信 业务员成长计划(转载业务员网) Nokia5230刷机呕心历程 .net 消息队列简单实例 开启SHAREPOINT 2007匿名用户搜索功能及moss搜索界面样式更换 MOSS爬网-搜索自定义带参数信息 Hosting WCF in SharePoint 2007 (Part 1) 基本部署(转)
WCF创建Rest服务(附:.net2.0创建Rest服务)
雷明 · 2010-08-13 · via 博客园 - 雷明

转(详见):http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/1bad2198-65cb-445d-84cb-1fae17828eef

分以下几步骤:
1、VS2008创建WCF服务项目
2、配置服务接口UriTemplate
   [OperationContract]
        [WebGet(UriTemplate = "/Tests/{sValue}", ResponseFormat = WebMessageFormat.Json)]
        string GetData(string sValue);
3、配置WebConfig,例:

<system.serviceModel>
    <services>
      <service behaviorConfiguration="BA.Services.SiteGetNewsServiceBehavior" name="BA.Services.SiteGetNewsService">
        <endpoint address="" behaviorConfiguration="WebHttp" binding="webHttpBinding"
          bindingConfiguration="" contract="BA.Services.ISiteGetNewsService" />
      </service> 
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="BA.Services.SiteGetNewsServiceBehavior">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
      </serviceBehaviors>

      <endpointBehaviors>
        <behavior name="WebHttp">
          <webHttp/>
        </behavior>
      </endpointBehaviors>
    </behaviors>
  </system.serviceModel>


4、配置*.svc服务标记:
   <%@ ServiceHost Language="C#" Debug="true" Service="Rest4Func.Service1" Factory="System.ServiceModel.Activation.WebServiceHostFactory" %>

5、测试服务:http://***/Service1.svc/tests/定义参数,弹出一个文件保存
6、实例(项目中以Service1.svc为例):/Files/lmjob/WcfRest.rar

附:.Net2.0创建Rest服务代码:
/Files/lmjob/RESTService.zip