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

新手写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. SQL Server优化相关的工具脚本

    SQL Server性能优化的一些常用脚本,适用于SQL Server 2008,更高的版本某些系统表的字段有所不同,建议参考MSDN. 死锁相关 /************************* ...

  2. IP查找工具——angry IP Scanner

    作用] 若树莓派没有屏幕可通过该工具查找树莓派的IP地址.例如下图的树莓派IP地址可能为192.168.1.107. 图1 IP scan查找树莓派IP地址

  3. python pro practice

  4. [Objective-c 基础 - 2.7] 构造方法、重写init方法

    A.id 万能指针,可以指向任何对象,实质是NSObject的指针,使用的时候不用加上*   B.NSObject中得类方法new 1.完整地创建一个可用对象步骤 (1)分配存储空间 + alloc ...

  5. 将NavigationBar设置透明

    将NavigationBar设置透明(仅将指定视图控制器进行透明处理),步骤如下:1.在视图控制器的头文件中实现UINavigationControllerDelegate,例如:@interface ...

  6. 配dump文件

    ulimit -c unlimited echo 'ulimit -c unlimited' >>/etc/profile

  7. 多路径配置vlome group共享存储,VG的更新。

    1.  PV的概念: a)        一块物理磁盘一块物理硬盘在被LVM管理时被称为“物理卷”. b)        在LVM能对其进行管理之前需要在硬盘上产生一些特殊的数据结构,这个过程就是建立 ...

  8. 编写一个Java应用程序,设计一个汽车类Vehicle,包含的属性有车轮个数 wheels和车重weight。小车类Car是Vehicle的子类,其中包含的属性有载人数 loader。卡车类Truck是Car类的子类,其中包含的属性有载重量payload。每个 类都有构造方法和输出相关数据的方法。最后,写一个测试类来测试这些类的功 能。

    package car; public class Vehicle { //定义成员变量 private int wheels; private double weight; public int g ...

  9. js与java通信

    js 调用java中的接口并传递参数给客户端处理方式: webView.addJavascriptInterface(new NewsDetail() , "newsDetail" ...

  10. How to add “Maven Managed Dependencies” library in build path eclipse

    If you have m2e installed and the project already is a maven project but the maven dependencies are ...