app.config 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?xml version="1.0"?>
  2. <configuration>
  3. <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup>
  4. <runtime>
  5. <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  6. <!--配置加载程序集时要查找的子目录 如:“Library;dll;bin;bin\subbin;”-->
  7. <probing privatePath="Library;dll;bin"/>
  8. </assemblyBinding>
  9. </runtime>
  10. <system.serviceModel>
  11. <services>
  12. <!--添加服务-->
  13. <service name="LYFZ.SWcfServiceLibrary.CommunicationService" behaviorConfiguration="CalculatorServiceBehavior">
  14. <!--name 必须与代码中的host实例初始化的服务一样
  15. behaviorConfiguration 行为配置-->
  16. <host>
  17. <baseAddresses>
  18. <!--添加调用服务地址-->
  19. <add baseAddress="http://localhost:8000/webService"/>
  20. </baseAddresses>
  21. </host>
  22. <!--添加契约接口 contract="LYFZ.SWcfService.ServiceContract" LYFZ.SWcfService.ServiceContract为契约接口 binding="wsHttpBinding" wsHttpBinding为通过Http调用-->
  23. <endpoint address="" binding="webHttpBinding" contract="LYFZ.SWcfServiceLibrary.ICommunication"></endpoint>
  24. </service>
  25. <service name="LYFZ.SWcfServiceLibrary.WsConnectService" behaviorConfiguration="WsCalculatorServiceBehavior">
  26. <!--name 必须与代码中的host实例初始化的服务一样
  27. behaviorConfiguration 行为配置-->
  28. <host>
  29. <baseAddresses>
  30. <!--添加调用服务地址-->
  31. <add baseAddress="http://localhost:8000/wsService"/>
  32. </baseAddresses>
  33. </host>
  34. <!--添加契约接口 contract="LYFZ.SWcfService.ServiceContract" LYFZ.SWcfService.ServiceContract为契约接口 binding="wsHttpBinding" wsHttpBinding为通过Http调用-->
  35. <endpoint address="" binding="wsHttpBinding" contract="LYFZ.SWcfServiceLibrary.IWsConnectService"></endpoint>
  36. </service>
  37. </services>
  38. <!--定义CalculatorServiceBehavior的行为-->
  39. <behaviors>
  40. <serviceBehaviors>
  41. <behavior name="CalculatorServiceBehavior">
  42. <serviceMetadata httpGetEnabled="true"/>
  43. <serviceDebug includeExceptionDetailInFaults="false"/>
  44. </behavior>
  45. <behavior name="WsCalculatorServiceBehavior">
  46. <serviceMetadata httpGetEnabled="true"/>
  47. <serviceDebug includeExceptionDetailInFaults="false"/>
  48. </behavior>
  49. </serviceBehaviors>
  50. </behaviors>
  51. </system.serviceModel>
  52. </configuration>