Linux学习日记-WCF RestFul的部署(三)
一、关于WCF 的部署
默认的wshttp风格的wcf是很容易部署上去的,但是这里给个建议尽量不要使用WCF的配置文件去部署尽管
我们都已经很熟悉了,在使用配置文件你会发现各种蛋疼的问题。
二、WCF Restful的部署
以下是简单的目录:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAASYAAAD4CAIAAADO5dxmAAAftElEQVR4nO3dW1Rb150/8PM09cN//mlWMvl3TWY1nodpslbrrJkF/5esaabT1PakbkniZvwAJXGaxJ1Om8Sx47j2YAMC3wKUO+YugUDhjiGAhLnKYAx2MNiYq0BGBYEgWNsI3QB7aR6OdHR0QyIR+0DyPeuzumSx9znm1N/sfc7R/onRzOo2JAtnIiXc6xCRkn0tjQyJ6dU4XjMRMvvrblGIo40kggmX8nfVGx3i9o7r/qWRzIabR18AeopLZMUlsiJpqaS4pEhayv7RrY2kuERWVllWUT2nWyqrqJaVVUqKS9zaMH6O1C0K4eI0KwsPEUVHuOYgQuaMljSSceZTx2aMS6YkgnEmkyONZLgYc0dhGIaJjI4JDYkRhTPeegFQV/p5+efllXyln5e7tZnTLZV+Xj6nW3J7zecncpKI0OhunWZWp4wJZRiG8TrKzToaeMmGfWRTxoS6tmdzxTCMff/OQzhC6+ziGP3cjghA05xuyZPXZl5fc/yNcgAQVIgcAFWIHABViBwAVYgcAFWIHABViBwAVYgcAFWIHABViBwAVYFG7lp3j7SkNEDXunsE/8UAtqdAI1csLSGEEEIMBsPa2prNY1tfXzeZTMvLy4SQYqn7p6cBgBVo5IqKpYQQrVY7Pz+/uLi45LG1tbUtLi42NzcTQoqKpYL/YgDbU6CRkxQVs5Gbm5vT6XRf8TYudQsLC3Nzc4QQSVGxS1+XhXOycN7qAZe1drO90SGONUH2JQvcggOsJIBviUAjJ5YUEULm4nUzsVpN9AzfTKx2Ll7HIYSIJUUu3d3WsPLC41yh0y0K4S9C7RZFS3Xu+QTY+ZjW9mu7du1yW3+9a9eu1vZr/HYFhWJCiDZufvrsX92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AFWIHABViBwAVYgcAFWIHABViBwAVYgcAFWIHABViBwAVYgcAFWIHABViBwAVYgcAFWIHABViBwAVYgcAFWIHABViBwAVYgcAFWIHABViBwAVYgcAFWIHABViBwAVYgcAFWIHABViBwAVYgcAFWIHABV/wtj9eX2kgLSpwAAAABJRU5ErkJggg==" alt="" />
最主要的是主机的代码:
注: 一定要用代码,而不用配置文件 否则帮助页、默认返回格式什么的以配置就报异常
接口IService 类
using System;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web; namespace Services
{
[ServiceContract]
public interface IService
{
[OperationContract,WebGet(UriTemplate="test/{name}")]
string GetData (string name);
}
} 服务Service 类
using System; namespace Services
{
public class Service:IService
{
public string GetData(string name)
{
return name; }
}
} 主机启动服务的方法: using System;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.ServiceModel.Description;
using Services; namespace Hosting
{
class MainClass
{
public static void Main (string[] args)
{
using (WebServiceHost host = new WebServiceHost (typeof(Services.Service))) {
//host.AddServiceEndpoint(typeof(ICalculator), new WebHttpBinding(), "http://127.0.0.1:9999/"); ServiceEndpoint endpoint = host.AddServiceEndpoint(typeof(Services.IService), new WebHttpBinding(), "http://127.0.0.1:9999/");
if (host.Description.Behaviors.Find<WebHttpBehavior> () == null) {
WebHttpBehavior httpBehavior = new WebHttpBehavior ();
httpBehavior.HelpEnabled = true; //打开帮助页
httpBehavior.DefaultOutgoingResponseFormat = WebMessageFormat.Json;//指定返回格式为“Json”
httpBehavior.DefaultBodyStyle = WebMessageBodyStyle.Bare; //正文消息样式
httpBehavior.AutomaticFormatSelectionEnabled = false; //是否自动返回格式
endpoint.Behaviors.Add (httpBehavior);//添加终结点
}
host.Opened += delegate {
Console.WriteLine ("服务已启动!");
};
host.Open();
Console.ReadKey();
}
}
}
}
using System;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
namespace Services
{
[ServiceContract]
public interface IService
{
[OperationContract,WebGet(UriTemplate="test/{name}")]
string GetData (string name);
}
}
Linux学习日记-WCF RestFul的部署(三)的更多相关文章
- Linux学习日记-EF6的安装升级(三)
在vs2013中使用EF是5的但是如果想使用 “来自数据库据的Code First” 这个生成模板就会发现 它会提示你EF的版本太低请升级 下面就是解决办法: 安装实体框架6 在工具菜单中,点击NuG ...
- Linux学习日记-使用EF6 Code First(四)
一.在linux上使用EF 开发环境 VS2013+mono 3.10.0 +EF 6.1.0 先检测一下EF是不是6的 如果不是 请参阅 Linux学习日记-EF6的安装升级(三) 由于我的数据库 ...
- Linux学习日记——字符处理
(菜鸡学习日记 各种使用命令只列举了常用几种,发现错误望指正) 一.管道 在Linux 中,管道就是一个固定大小的缓冲区,大小为一页4K.它是一种通信的机制,可以使用管道符“ | ” 来连接进程,连接 ...
- Linux 学习日记 1
这是我第一次系统地学习Linux,希望通过这个学习日记收获一些东西把-- @_@ Grub - 启动管理器 在启动时让用户选择要启动的系统.(但是windows比较霸道--重装windows后会将 ...
- Linux学习日记-MVC的部署(三)
一.Mvc与wcf 相对WCF的部署MVC还是有点麻烦,我们要考虑哪些dll是不需要的,哪些是要拷贝到本地的. 而WCF因为有些配置文件不支持,我们只需要在配置wcf时不使用配置文件而直接使用代码就行 ...
- Linux学习笔记之Django项目部署(CentOS)
一.引入 用Django写了一个测试的项目,现在要部署在Linux上,一般这种情况下,只要在项目里面敲一行命令:python manage.py runserver 0.0.0.0:8000就行了.但 ...
- Linux学习日记——源码编译Apache
[本文为笔者在学习Linux 下的软件安装时,尝试使用源码安装Apache 的过程,事后进行一个小小的总结,发现错误望指正.] 一.典型的源码编译安装软件的过程包括以下3步: 1) 运行 config ...
- Linux学习日记-(一)
一.为什么学习Linux 大学时开始接触Linux,最开始学习的是RedHat(小红帽),感觉Linux好像很久不见的老朋友,用起来很舒服(虽然我们用的是DotNet).很喜欢它的命令模式,让我能接触 ...
- Linux学习笔记之Django项目部署(CentOS)----进阶篇
一.引入 当我们开发好了一个Django项目之后是需要部署到服务器上的,这样才能正式使用这个项目.之前用了一个运行.sh文件的方法让项目得以在后台运行,其实随着学习的深入,这种方法其实是有点low的, ...
随机推荐
- 移动端之Android开发的几种方式的初步体验
目前越来越多的移动端混合开发方式,下面列举的大多数我都略微的尝试过,就初步的认识写个简单的心得: 开发方式 开发环境 是否需要AndroidSDK 支持跨平台 开发语言&技能 MUI Win+ ...
- 通过ProGet搭建一个内部的Nuget服务器
.NET Core项目完全使用Nuget 管理组件之间的依赖关系,Nuget已经成为.NET 生态系统中不可或缺的一个组件,从项目角度,将项目中各种组件的引用统统交给NuGet,添加组件/删除组件/以 ...
- 百度 flash html5自切换 多文件异步上传控件webuploader基本用法
双核浏览器下在chrome内核中使用uploadify总有302问题,也不知道如何修复,之所以喜欢360浏览器是因为帮客户控制渲染内核: 若页面需默认用极速核,增加标签:<meta name=& ...
- .net Elasticsearch 学习入门笔记
一. es安装相关1.elasticsearch安装 运行http://localhost:9200/2.head插件3.bigdesk插件安装(安装细节百度:windows elasticsear ...
- "NHibernate.Exceptions.GenericADOException: could not load an entity" 解决方案
今天,测试一个项目的时候,抛出了这个莫名其妙的异常,然后就开始了一天的调试之旅... 花了很长时间,没有从代码找出任何问题... 那么到底哪里出问题呢? 根据下面那段长长的错误日志: -- ::, ...
- WebStorm 2016 最新版激活(activation code方式)
WebStorm 2016 最新版激活(activation code方式) WebStorm activation code WebStorm 最新版本激活方式: 今天下载最新版本的WebStorm ...
- myrocks复制中断问题排查
背景 mysql可以支持多种不同的存储引擎,innodb由于其高效的读写性能,并且支持事务特性,使得它成为mysql存储引擎的代名词,使用非常广泛.随着SSD逐渐普及,硬件存储成本越来越高,面向写优化 ...
- MySQL+Amoeba实现数据库主从复制和读写分离
MySQL读写分离是在主从复制的基础上进一步通过在master上执行写操作,在slave上执行读操作来实现的.通过主从复制,master上的数据改动能够同步到slave上,从而保持了数据的一致性.实现 ...
- Create a bridge using a tagged vlan (8021.q) interface
SOLUTION VERIFIED April 27 2013 KB26727 Environment Red Hat Enterprise Linux 5 Red Hat Enterprise Li ...
- 超千个节点OpenStack私有云案例(1):CERN 5000+ 计算节点私有云
CERN:欧洲核子研究组织 本文根据以下几篇文章整理而来: https://www.openstack.org/summit/tokyo-2015/videos/presentation/unveil ...