<个人积累,转载请注明出处>

新手写rest wcf经常会报配置文件异常。我为了避免这种问题,将自己配好的config放这里,用的时候将ABC改成自己的,粘贴就行了。

ABC是什么我就不赘述了,给个链接 http://blog.csdn.net/lglgsy456/article/details/7637332

<configuration>

    <system.web>

      <compilation debug="true" targetFramework="4.0" />

    </system.web>

  <system.serviceModel>

    <services>

      <service name="Akmii.Chint.Service.test">

        <endpoint address="" behaviorConfiguration="RestBehavior" binding="webHttpBinding"

          bindingConfiguration="HttpBinds" contract="Akmii.Chint.Service.test" />

      </service>

      <service name="Akmii.Chint.Service.SendRest">

        <endpoint address="" behaviorConfiguration="Akmii.Chint.Service.SendRestAspNetAjaxBehavior"

          binding="webHttpBinding" contract="Akmii.Chint.Service.SendRest" />

      </service>

      <service name="Akmii.Chint.Service.ReceiveRest">

        <endpoint address="" behaviorConfiguration="Akmii.Chint.Service.ReceiveRestAspNetAjaxBehavior"

          binding="webHttpBinding" contract="Akmii.Chint.Service.ReceiveRest" />

      </service>

    </services>

    <behaviors>

      <endpointBehaviors>

        <behavior name="RestBehavior">

          <webHttp helpEnabled="true" defaultBodyStyle="Bare" defaultOutgoingResponseFormat="Json" />

        </behavior>

        <behavior name="Akmii.Chint.Service.SendRestAspNetAjaxBehavior">

          <enableWebScript />

        </behavior>

        <behavior name="Akmii.Chint.Service.ReceiveRestAspNetAjaxBehavior">

          <enableWebScript />

        </behavior>

      </endpointBehaviors>

      <serviceBehaviors>

        <behavior name="">

          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />

          <serviceDebug includeExceptionDetailInFaults="true" />

        </behavior>

      </serviceBehaviors>

    </behaviors>

    <serviceHostingEnvironment aspNetCompatibilityEnabled="true"

      multipleSiteBindingsEnabled="true" />

    <bindings>

      <webHttpBinding>

        <binding name="HttpsBinds">

          <security mode="Transport"></security>

        </binding>

        <binding name="HttpBinds" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"></binding>

      </webHttpBinding>

    </bindings>

  </system.serviceModel>

</configuration>

  

rest的config的更多相关文章

  1. 一步步开发自己的博客 .NET版(11、Web.config文件的读取和修改)

    Web.config的读取 对于Web.config的读取大家都很属性了.平时我们用得比较多的就是appSettings节点下配置.如: 我们对应的代码是: = ConfigurationManage ...

  2. Discuz NT 架构剖析之Config机制

    接触了Discuz NT! 一段时间了,是时候做个总结了,标题好霸气,有木有? 都是托园子里的大牛代振军的福啊,哈哈哈哈. 首先论坛的信息不是完全存储在数据库里面的,一部分信息存储在config文件里 ...

  3. [笔记]HAproxy reload config file with uninterrupt session

    HAProxy is a high performance load balancer. It is very light-weight, and free, making it a great op ...

  4. MyBatis2:config.xml文件

    前言 前一篇文章,讲了MyBatis入门,讲到了MyBatis有两个基本的配置文件,一个用来配置环境信息,一个用来写SQL语句.前者我把它命名为config.xml,config.xml的内容是: & ...

  5. 搞了我一下午竟然是web.config少写了一个点

    Safari手机版居然有个这么愚蠢的bug,浪费了我整个下午,使尽浑身解数,国内国外网站搜索解决方案,每一行代码读了又想想了又读如此不知道多少遍,想破脑袋也想不通到底哪里出了问题,结果竟然是web.c ...

  6. WCF中,通过C#代码或App.config配置文件创建ServiceHost类

    C# static void Main(string[] args) { //创建宿主的基地址 Uri baseAddress = new Uri("http://localhost:808 ...

  7. myeclipse 无法启动 java.lang.IllegalStateException: Unable to acquire application service. Ensure that the org.eclipse.core.runtime bundle is resolved and started (see config.ini).

    把myeclipse10 按照目录完整拷贝到了另外一台电脑, 另外的目录 原安装目录 D\:\soft\i\myeclipse10 新安装目录 E\:\soft\myeclipse10 双击启动失败, ...

  8. PHP扩展-如何使用文件config.m4

    config.m4文件用于指定正在开发的扩展在类unix系统下构建时支持的选项,指定此扩展需要哪些库以及哪些源文件:使用 GNU autoconf 语法编写.注意需要重新执行phpize,config ...

  9. RabbitMQ Config

    默认访问地址:http://localhost:15672/ 要想修改内网访问: %APPDATA%\RabbitMQ\ 目录下添加文件 rabbitmq.config [ {rabbit, [%% ...

  10. C# 读取app.config配置文件 节点键值,提示 "配置系统未能初始化" 错误的解决方案

    新建C#项目,在app.config中添加了appSettings项,运行时出现"配置系统未能初始化"的错误,MSDN里写到,如果配置文件中包含 configSections 元素 ...

随机推荐

  1. localtime()方法的疑惑

    在做一个时间管理的APP中遇到一些问题 windows linux mac下time.h中都有关于localtime()的定义. 它不是一个保险可靠的方法,使用的时候需要小心. 参考 http://b ...

  2. Spring配置MyBatis

    1.MyBatis配置文件(mybatis-config) <?xml version="1.0" encoding="UTF-8"?> <! ...

  3. mysql 查询多个id

    select * from b1 where find_in_set('4',id); select * from b1 where id in (1,2,3,22);

  4. SQL2008-备份SQL数据库的语句

    SQL2008:1.备份库BACKUP DATABASE CDJQ_CEM2008 TO DISK = 'd:\zhu\123.bak'2.开启RAR加压功能EXEC sp_configure 'sh ...

  5. 理解js中的原型链,prototype与__proto__的关系

    说到prototype,就不得不先说下new的过程. 我们先看看这样一段代码: 1 <script type="text/javascript"> 2 var Pers ...

  6. c# 泛型List的定义、作用、用法

    定义:List<T>类表示可通过索引访问的对象的强类型列表,提供用于对列表进行搜索.排序和操作的方法. 作用: 泛型最常见的用途是泛型集合 我们在创建列表类时,列表项的数据类型可能是int ...

  7. iOS UITabBarItem 选中图的颜色,设置UIimage的渲染模式

    UITbarController之前有在这篇文章讲解:http://www.cnblogs.com/niit-soft-518/p/4447940.html 如果自定义了UITabBarItem的图片 ...

  8. JSON 之FastJson解析

    http://blog.sina.com.cn/s/blog_7ffb8dd501013qas.html 一.阿里巴巴FastJson是一个Json处理工具包,包括“序列化”和“反序列化”两部分,它具 ...

  9. [AngularJS] Catching errors with $exceptionHandler

    The AngularJS $exceptionHandler service allows you to catch and handle unanticipated JavaScript erro ...

  10. memcached在windows下的安装与命令使用方法

    先下载memcached for win32 下载地址1:http://filemarkets.com/fs/8tdo6ndg41d919599/ 下载地址2:http://www.400gb.com ...