在c#下用 WCF编写restful
1、添加WCF服务库
2、在global里面注册路由
RouteTable.Routes.Add(new ServiceRoute("api", new WebServiceHostFactory(), typeof(api.OpenApi.OpenApi)));
3、在webconfig里面添加如下配置
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
<standardEndpoints>
<webHttpEndpoint>
<standardEndpoint name="" helpEnabled="true" automaticFormatSelectionEnabled="true" crossDomainScriptAccessEnabled="false" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" maxBufferPoolSize="4194304" />
</webHttpEndpoint>
</standardEndpoints>
<bindings>
<webHttpBinding>
<binding closeTimeout="04:01:00"
openTimeout="04:01:00" receiveTimeout="04:10:00" sendTimeout="04:01:00"
allowCookies="false" bypassProxyOnLocal="false"
hostNameComparisonMode="StrongWildcard"
maxBufferSize="2147483647" maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647"> <readerQuotas maxDepth="128" maxStringContentLength="2147483647" maxArrayLength="2147483647"
maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
</binding>
</webHttpBinding>
<!--发短信-->
<basicHttpBinding>
<binding name="serviceSoap" />
</basicHttpBinding>
<!--发短信-->
</bindings>
<!--发短信-->
<client>
<endpoint address="http://api5.nashikuai.cn/service.asmx" binding="basicHttpBinding"
bindingConfiguration="serviceSoap" contract="smsServices.serviceSoap"
name="serviceSoap" />
</client>
<!--发短信-->
</system.serviceModel>
在c#下用 WCF编写restful的更多相关文章
- 在IIS8.5的环境下配置WCF的Restful Service
今天在客户的环境中(Windows Server 2012 R2 + IIS 8.5)搭建Call WCF Restful Service的功能,发现了几个环境配置的问题,记录如下: 1):此环境先安 ...
- Django编写RESTful API(一):序列化
欢迎访问我的个人网站:www.comingnext.cn 关于RESTful API 现在,在开发的过程中,我们经常会听到前后端分离这个技术名词,顾名思义,就是前台的开发和后台的开发分离开.这个技术方 ...
- Django编写RESTful API(四):认证和权限
欢迎访问我的个人网站:www.comingnext.cn 前言: 按照前面几篇文章里那样做,使用Django编写RESTful API的基本功能已经像模像样了.我们可以通过不同的URL访问到不同的资源 ...
- Spring Boot 2.x 编写 RESTful API (五) 单元测试
用Spring Boot编写RESTful API 学习笔记 概念 驱动模块 被测模块 桩模块 替代尚未开发完毕的子模块 替代对环境依赖较大的子模块 (例如数据访问层) 示例 测试 Service @ ...
- Spring Boot 2.x 编写 RESTful API (四) 使用 Mybatis
用Spring Boot编写RESTful API 学习笔记 添加依赖 <dependency> <groupId>org.mybatis.spring.boot</gr ...
- RESTful规范与django编写restful接口
一.什么是RESTful规范 ①REST与技术无关,代表的是一种软件架构风格,REST是Representational State Transfer的简称,中文翻译为“表征状态转移” ②REST从资 ...
- Mono下的WCF的Bug?
最近一段时间,一直在折腾Mono,折腾Linux.让我无比痛苦的是Mono下的WCF的坑真的是太多了,这不又遇到了一个莫名其妙的问题. 环境:mono 3.2.1,Jexus 5.4.3,OS Cen ...
- 利用 Django REST framework 编写 RESTful API
利用 Django REST framework 编写 RESTful API Updateat 2015/12/3: 增加 filter 最近在玩 Django,不得不说 rest_framewor ...
- .Net Core下使用WCF
在.net core 下的wcf 和framework下的wcf使用方式有点不太一样.在core下用wc,需要安装VS扩展Visual Studio WCF Connected Service,目前这 ...
随机推荐
- 1009 Product of Polynomials (25 分)
1009 Product of Polynomials (25 分) This time, you are supposed to find A×B where A and B are two pol ...
- 取得 Ajax 返回参数
ajax 函数,p1 为正常参数 function ExecWebFunction(callback,p1) { $.ajax({ type: "POST", contentTyp ...
- 使用HTML引用标签来分隔Ticket回复
今天在查看Ticket的时候,发现如何和客户之间有很多个来回,Ticket的Correspondence就会很长很长,虽然我们有自己的Breakline,但是由于客户回复邮件时,添加的用于分隔旧信息和 ...
- fs和http模块
fs模块写入文件的方式 导入内置模块 const fs=require("fs") 一.异步写入方式 fs.writeFile("写入文件的路径&qu ...
- Django的DRF序列化方法
安装rest_framework -- pip install djangorestframework -- 注册rest_framework序列化 -- Python--json -- 第一版 用v ...
- [Python] numpy.logspace
numpy.logspace(start, stop, num=50, endpoint=True, base=10.0, dtype=None) starting value := base** ...
- node进阶之用流实现上传文件
内容: 1.文件上传基础 2.node文件处理机制 3.用流实现文件上传 1.文件上传基础 前端代码: <form action="localhost:8080/" meth ...
- XMind8 安装
参考:https://blog.csdn.net/qq_35911589/article/details/81901868 https://blog.csdn.net/Zjhao666/article ...
- leetcode743
class Solution { public: int networkDelayTime(vector<vector<int>>& times, int N, int ...
- mysql:rand()产生随机整数,CONCAT拼接时间字符串
用存储过程插入测试数据,如果不想update_time都一样,可以进行随机字符串拼接:2月随机1天,小时随机 CONCAT('2017-02-',FLOOR(1 + (RAND() * 28)),' ...