1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <?xml version="1.0"?>
- <configuration>
- <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup>
- <runtime>
- <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
- <!--配置加载程序集时要查找的子目录 如:“Library;dll;bin;bin\subbin;”-->
- <probing privatePath="Library;dll;bin"/>
- </assemblyBinding>
- </runtime>
- <system.serviceModel>
- <services>
- <!--添加服务-->
- <service name="LYFZ.SWcfServiceLibrary.CommunicationService" behaviorConfiguration="CalculatorServiceBehavior">
- <!--name 必须与代码中的host实例初始化的服务一样
- behaviorConfiguration 行为配置-->
- <host>
- <baseAddresses>
- <!--添加调用服务地址-->
- <add baseAddress="http://localhost:8000/webService"/>
- </baseAddresses>
- </host>
- <!--添加契约接口 contract="LYFZ.SWcfService.ServiceContract" LYFZ.SWcfService.ServiceContract为契约接口 binding="wsHttpBinding" wsHttpBinding为通过Http调用-->
- <endpoint address="" binding="webHttpBinding" contract="LYFZ.SWcfServiceLibrary.ICommunication"></endpoint>
- </service>
- <service name="LYFZ.SWcfServiceLibrary.WsConnectService" behaviorConfiguration="WsCalculatorServiceBehavior">
- <!--name 必须与代码中的host实例初始化的服务一样
- behaviorConfiguration 行为配置-->
- <host>
- <baseAddresses>
- <!--添加调用服务地址-->
- <add baseAddress="http://localhost:8000/wsService"/>
- </baseAddresses>
- </host>
- <!--添加契约接口 contract="LYFZ.SWcfService.ServiceContract" LYFZ.SWcfService.ServiceContract为契约接口 binding="wsHttpBinding" wsHttpBinding为通过Http调用-->
- <endpoint address="" binding="wsHttpBinding" contract="LYFZ.SWcfServiceLibrary.IWsConnectService"></endpoint>
- </service>
- </services>
- <!--定义CalculatorServiceBehavior的行为-->
- <behaviors>
- <serviceBehaviors>
- <behavior name="CalculatorServiceBehavior">
- <serviceMetadata httpGetEnabled="true"/>
- <serviceDebug includeExceptionDetailInFaults="false"/>
- </behavior>
- <behavior name="WsCalculatorServiceBehavior">
- <serviceMetadata httpGetEnabled="true"/>
- <serviceDebug includeExceptionDetailInFaults="false"/>
- </behavior>
- </serviceBehaviors>
- </behaviors>
- </system.serviceModel>
- </configuration>
|