App.config 2.6 KB

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