子曾经曰过

  博客园  :: 首页  ::  ::  ::  :: 管理

服务类命名空间 StreamTranlate

服务类名 Service1

服务接口 IService1

app.config

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<!--调试用,编程时要开着debug-->
<system.web>
<compilation debug="true"></compilation>
</system.web>

<!--配置一个WCF基本的要求
<system.serviceModel>
<services></services>
<behaviors></behaviors>
<bindings></bindings>
</system.serviceModel>
-->
<system.serviceModel>
<services>
<!--name属性值是命名空间+服务类名,不可或缺。behaviorConfiguration需要填写,它的值在另一个节点behaviors中的子节点里由name值指定。-->
<service behaviorConfiguration="xingwei" name="StreamTranlate.Service1">
<!--service中有行为配置属性时候,终结点不能再配置行为配置属性了,service节点中还不能少行为配置属性值-->
<!--终结点为多个时,客户端实例化时需要提供终结点name名字具体实例化-->
<!--binding属性指明该终结点使用哪一种绑定传输方式,值不能写错,有固定的几个.元数据固定式mexHttpBinding,不能写错-->
<!--contract是协议名称,值为命名空间+服务接口,IMetadataExchange是指元数据交换,不能写错-->
<!--bindingConfiguration绑定配置,该值在bindings的子节点binding里的name值指定-->
<!--address为空时值默认为<host>子节点<baseAddresses>的add里的baseAddress指定。手工赋值将覆盖baseAddress的值-->
<!--address可以随便写-->
<endpoint name="endpoint1" address="" binding="wsHttpBinding" contract="StreamTranlate.IService1" bindingConfiguration="WoDebinding" />
<endpoint name="endpointmex" address="mex1" binding="mexHttpBinding" contract="IMetadataExchange" />
<endpoint name="endpoint2" address="http://localhost:8888/anotherendpoint" binding="wsHttpBinding" contract="StreamTranlate.IService1" bindingConfiguration="WoDebinding" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:88/caonidaye" />
</baseAddresses>
</host>
</service>
<service behaviorConfiguration="" name="servicetestname">
<endpoint address="" binding="basicHttpBinding" contract="" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="xingwei">
<serviceMetadata httpGetEnabled="true" />
</behavior>
<behavior name="SexXingwei">
<serviceMetadata httpGetEnabled="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<wsHttpBinding>
<binding name="WoDebinding" >
<security mode="None"></security>
</binding>
</wsHttpBinding>
</bindings>
</system.serviceModel>
</configuration>
posted on 2011-02-15 01:58  人的本质是什么?  阅读(283)  评论(0编辑  收藏  举报