发布服务元数据的方式有两种:一是基于HTTP-GET协议提供元数据,它是一种绝大多数平台都能支持的简单text-based协议;另一种是元数据交换终结点。

1.基于HTTP-GET协议

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<services>
<service name="HelloWCFService.HelloWCFService" behaviorConfiguration="metaExchange">
<host>
<baseAddresses>
<add baseAddress="http://localhost:8000/MyService"/>
</baseAddresses>
</host>
<endpoint address="HelloWCFService" binding="wsHttpBinding" contract="HelloWCFService.IHelloWCFService"/>
<!--<endpoint address="metaExchange" binding="mexHttpBinding" contract="IMetadataExchange"/>-->
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="metaExchange">
<serviceMetadata httpGetEnabled="true"/>
<!--<serviceMetadata/>-->
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>

2.元数据交换终结点

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<services>
<service name="HelloWCFService.HelloWCFService" behaviorConfiguration="metaExchange">
<host>
<baseAddresses>
<add baseAddress="http://localhost:8000/MyService"/>
</baseAddresses>
</host>
<endpoint address="HelloWCFService" binding="wsHttpBinding" contract="HelloWCFService.IHelloWCFService"/>
<endpoint address="metaExchange" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="metaExchange">
<!--<serviceMetadata httpGetEnabled="true"/>-->
<serviceMetadata/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>

  

C# WCF发布服务的元数据的方式的更多相关文章

  1. IIS上发布WCF发布服务,访问不到

    1 环境是IIS7,发布WCF发布服务,访问不到. 一种原因站点自动生成“程序应用池”和站点的Framwork版本不一致. 解决的办法:新建一个“程序应用池”,然后站点指向这个新建的“程序应用池”

  2. WCF分布式服务1-核心概念

    参考msdn library for WCF Windows Communication Foundation (WCF) 是用于构建面向服务的应用程序的框架. 借助 WCF,可以将数据作为异步消息从 ...

  3. 利用ArcEngine开发地图发布服务,将mxd文档一键发布成wmts,并根据需要对地图进行空间查询,返回客户端geojson

    一直想开发一个软件取代ArcGIS Server,该软件使用ArcEngine开发,以Windows Service形式发布,部署在服务端上,解决wmts地图服务发布和空间查询的问题,经过不断的研究. ...

  4. WCF公开服务元数据方式

    一般我们使用了scvutil命令自动生成了服务的客户端代理类: 例如:svcutil http://localhost:8000/?wsdl /o:FirstServiceClient.cs 命令中h ...

  5. WCF报 当前已禁用此服务的元数据发布的错误

    这是 Windows© Communication Foundation 服务. 当前已禁用此服务的元数据发布. 如果具有该服务的访问权限,则可以通过完成下列步骤来修改 Web 或应用程序配置文件以便 ...

  6. WCF之服务元数据

    服务元数据是用来获得服务的EndPoint的信息,也就是它的ABC. 服务有两种方案可以发布自己的元数据. 一种是基于HTTP-GET协议提供元数据: 一种是元数据交换方式,它往往使用一个专门的终结点 ...

  7. 调用WCF服务的几种方式

    首先发布了一个名为PersonService的WCF服务.服务契约如下: [ServiceContract]     public interface IPersonService     {     ...

  8. [数据共享(干货)] wcf rest 服务发布数据 以及获得数据

    最近在做一个项目 ,需要我们做一个东西,我们姑且叫数据共享吧,我们公司叫A公司,对方公司叫B公司,就是A公司提供一个数据服务接口出去,B公司如果想拿我们数据的时候直接调用我们的服务接口就行了,我们同样 ...

  9. WCF发布方式介绍

    转载出处:http://blog.csdn.net/fangxing80/article/details/6101790 从VS2005推出WCF以来,WCF逐步取代了Remoting, WebSer ...

随机推荐

  1. TensorFlow实战第六课(过拟合)

    本节讲的是机器学习中出现的过拟合(overfitting)现象,以及解决过拟合的一些方法. 机器学习模型的自负又表现在哪些方面呢. 这里是一些数据. 如果要你画一条线来描述这些数据, 大多数人都会这么 ...

  2. 【Linux开发】linux设备驱动归纳总结(六):3.中断的上半部和下半部——工作队列

    linux设备驱动归纳总结(六):3.中断的上半部和下半部--工作队列 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ...

  3. C++学习笔记-namespace

    指标识符的各种可见范围.C++标准程序库中的所有标识符都被定义于一个名为std的namespace中 关于iostream <iostream>和<iostream.h>格式不 ...

  4. 使用choco 在windows 环境安装kubectl 并配置

    首先安装choco #以管理员身份运行cmd命令 @"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -N ...

  5. C# async await的使用

    async 声明一个包含异步代码的函数,该函数执行时不会阻塞调用线程. async标记的函数返回值必须为 void ,Task,Task<TResult> await 必须修饰Task 或 ...

  6. [xpath] 定位中starts-with、contains和text()的用法

    starts-with 顾名思义,匹配一个属性开始位置的关键字 contains 匹配一个属性值中包含的字符串 text() 匹配的是显示文本信息,此处也可以用来做定位用 eg //input[sta ...

  7. 3.Java和hadoop的安装

    先创建目录 [hadoop@node1 opt]$ cd /opt [hadoop@node1 opt]$ sudo mkdir /opt/softwares [hadoop@node1 opt]$ ...

  8. 【3.2】【mysql基本实验】mysql GTID复制(基于空数据的配置)

    概述:本质上和传统异步复制没什么区别,就是加了GTID参数. 且可以用传统的方式来配置主从,也可以用GTID的方式来自动配置主从. 这里使用GTID的方式来自动适配主从. 需要mysql5.6.5以上 ...

  9. C++练习 | 类的继承与派生练习(1)

    #include <iostream> #include <cmath> #include <cstring> #include <string> #i ...

  10. Linux下用OTL操作MySql(包含自己封装的类库及演示样例代码下载)

    版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/ClamReason/article/details/23971805 首先重点推荐介绍otl介绍及使 ...