zoukankan      html  css  js  c++  java
  • wcf首次使用代码配置文件记录

    服务器端配置文件

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
        <system.serviceModel>
            <services>
                <service name="SampleContract.Bird" behaviorConfiguration="Messagebehavior">
                    <host>
                        <baseAddresses>
                            <add baseAddress = "http://localhost:23451/SampleContract/" />
                            
                        </baseAddresses>
                    </host>
                    <endpoint address="" binding="wsHttpBinding"  contract ="SampleContract.IFly" bindingConfiguration="WSHttpBinding_IFly">
                    </endpoint>
            
    
                </service>
            </services>
            <bindings>
                <wsHttpBinding>
                    <binding name="WSHttpBinding_IFly">
                        <security mode="None"></security>
                    </binding>
                </wsHttpBinding>
            </bindings>
            
            <behaviors>
                <serviceBehaviors>
                    <behavior name="Messagebehavior">
                        <serviceMetadata httpGetEnabled="true"></serviceMetadata>
                        <serviceDebug includeExceptionDetailInFaults="true"></serviceDebug>
                    </behavior>
                </serviceBehaviors>
            </behaviors>
        </system.serviceModel>
        <startup> 
            <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
        </startup>
    </configuration>

    客户端配置文件

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
        <startup> 
            <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
        </startup>
        <system.serviceModel>
            <bindings>
                <wsHttpBinding>
                    <binding name="WSHttpBinding_IFly">
                        <security mode="None"></security>
                    </binding>
                </wsHttpBinding>
            </bindings>
            <client>
                <endpoint address="http://192.168.0.106:23451/SampleContract/" binding="wsHttpBinding"
                    bindingConfiguration="WSHttpBinding_IFly" contract="MyServiceReference2.IFly"
                    name="WSHttpBinding_IFly">
                    <identity>
                        <userPrincipalName value="LAPTOP-UUEOUOBAlex" />
                    </identity>
                </endpoint>
            </client>
        </system.serviceModel>
    </configuration>
  • 相关阅读:
    家庭记账本1
    寒假福利5
    寒假福利4——定位功能
    寒假福利3——日期时间选择器
    寒假作业——家庭小账本1.6(总结)
    寒假作业——家庭小账本1.5
    寒假作业——家庭小账本1.4
    寒假作业——家庭小账本1.3
    寒假作业——家庭小账本1.2
    寒假作业——家庭小账本1.1
  • 原文地址:https://www.cnblogs.com/dangnianxiaoqingxin/p/13873930.html
Copyright © 2011-2022 走看看