基础(使得IIS支持TCP协议)

来源:互联网 发布:炎黄网络怎么连接 编辑:程序博客网 时间:2024/06/05 01:03

iis支持多种协议

1、安装WAS



2、配置IIS



3、设置服务的web.config

 <netTcpBinding>
        <security mode="None">
          <transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
          <message clientCredentialType="Windows" />
        </security>
      </netTcpBinding>
    </bindings>
    
    <services>
      <service behaviorConfiguration="MyBehavior" name="WCFService.Service1">
        <endpoint address="" binding="netTcpBinding" contract="WCFService.IService1" bindingConfiguration="netTcpBindConfig"></endpoint>
        <endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange" ></endpoint>
      </service>
    </services>
    
    <behaviors>
      <serviceBehaviors>
        <behavior name="MyBehavior" >
          <serviceMetadata/>
          <serviceDebug includeExceptionDetailInFaults="true" />
          <dataContractSerializer maxItemsInObjectGraph="6553600"/>
        </behavior>
      </serviceBehaviors>


4、设置客户端,使其支持net.tcp协议

原创粉丝点击