Advertisement
Guest User

Untitled

a guest
Apr 24th, 2014
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.49 KB | None | 0 0
  1. public interface IService1 : MyExternalService
  2.  
  3. public class Service1 : IService1
  4. {
  5. public string GetData(int value)
  6. {
  7. return string.Format("You entered: {0}", value);
  8. }
  9.  
  10. public string ExternalMethod1(string a, string b)
  11. {
  12. throw new NotImplementedException();
  13. }
  14.  
  15. //etc
  16.  
  17. <configuration>
  18.  
  19. <appSettings>
  20. <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
  21. </appSettings>
  22. <system.web>
  23. <compilation debug="true" targetFramework="4.5" />
  24. <httpRuntime targetFramework="4.5"/>
  25. </system.web>
  26. <system.serviceModel>
  27. <bindings>
  28. <wsHttpBinding>
  29. <binding name="WSHttpBinding_IExternalService">
  30. <security>
  31. <message clientCredentialType="Certificate" />
  32. </security>
  33. </binding>
  34. <binding name="WSHttpBinding_IExternalService1">
  35. <security>
  36. <message clientCredentialType="Certificate" negotiateServiceCredential="false"
  37. algorithmSuite="Basic128" establishSecurityContext="false" />
  38. </security>
  39. </binding>
  40. </wsHttpBinding>
  41. </bindings>
  42. <client>
  43. <endpoint address="http://service.com/ExternalService/ExternalService.svc"
  44. binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IExternalService"
  45. contract="ExternalService.IExternalService" name="WSHttpBinding_IExternalService">
  46. <identity>
  47. <dns value="service.com" />
  48. </identity>
  49. </endpoint>
  50. <endpoint address="http://service.com/ExternalService/ExternalService.svc/Java"
  51. binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IExternalService1"
  52. contract="ExternalService.IExternalService" name="WSHttpBinding_IExternalService1">
  53. <identity>
  54. <dns value="service.com" />
  55. </identity>
  56. </endpoint>
  57. </client>
  58. <behaviors>
  59. <serviceBehaviors>
  60. <behavior>
  61. <!-- To avoid disclosing metadata information, set the values below to false before deployment -->
  62. <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
  63. <!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
  64. <serviceDebug includeExceptionDetailInFaults="false"/>
  65. </behavior>
  66. </serviceBehaviors>
  67. </behaviors>
  68. <protocolMapping>
  69. <add binding="basicHttpsBinding" scheme="https" />
  70. </protocolMapping>
  71. <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
  72. </system.serviceModel>
  73. <system.webServer>
  74. <modules runAllManagedModulesForAllRequests="true"/>
  75. <!--
  76. To browse web app root directory during debugging, set the value below to true.
  77. Set to false before deployment to avoid disclosing web app folder information.
  78. -->
  79. <directoryBrowse enabled="true"/>
  80. </system.webServer>
  81.  
  82. </configuration>
  83.  
  84. <services>
  85. <service name="MyService.MyService" behaviorConfiguration="metadataBehavior">
  86. <endpoint
  87. address="http://localhost/MyService.svc"
  88. binding="customBinding" bindingConfiguration="jsonpBinding"
  89. behaviorConfiguration="MyService.MyService"
  90. contract="MyService.IMyService"/>
  91. <endpoint
  92. address="mex"
  93. binding="mexHttpBinding"
  94. contract="IMetadataExchange"/>
  95. </service>
  96. </services>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement