iis - Deploying WCF Service with both http and https bindings/endpoints -


i've written wcf web service consumption silverlight app. initially, service required basic http binding. need able deploy service use under both http , https. i've found settings web.config allow me follows:

<system.servicemodel>   <behaviors>     <endpointbehaviors>       <behavior name="silverlightfaultbehavior">         <silverlightfaults />       </behavior>     </endpointbehaviors>     <servicebehaviors>       <behavior name="cxtmappingwebservice.cxtmappingwebservicebehavior">         <servicemetadata httpgetenabled="true" httpsgetenabled="true" />         <servicedebug includeexceptiondetailinfaults="true" />       </behavior>     </servicebehaviors>   </behaviors>   <bindings>     <basichttpbinding>       <binding name="securehttpbinding">         <security mode="transport" />       </binding>       <binding name="basichttpbinding">         <security mode="none" />       </binding>     </basichttpbinding>   </bindings>   <services>     <service name="cxtmappingwebservice.cxtmappingwebservice" behaviorconfiguration="cxtmappingwebservice.cxtmappingwebservicebehavior">       <endpoint address="" bindingconfiguration="securehttpbinding" binding="basichttpbinding" contract="cxtmappingwebservice.icxtmappingwebservice" behaviorconfiguration="silverlightfaultbehavior" />       <endpoint address="" bindingconfiguration="basichttpbinding" binding="basichttpbinding" contract="cxtmappingwebservice.icxtmappingwebservice" behaviorconfiguration="silverlightfaultbehavior" />       <endpoint address="mex" binding="mexhttpbinding" contract="imetadataexchange" />     </service>   </services> </system.servicemodel> 

unfortunately, however, there's problem this.

this web service needs deployed hundreds of our customers' servers, , not of them using https. deploying server doesn't have https binding set in iis causes fail. there way have both of these bindings in web.config default without dying if there's not https binding set in iis?

we've got possible solution problem, doesn't fit our deployment requirements.

has else encountered before, , how did resolve it?

the accepted answer on page not of use if don't use installer. correct answer lies in later edit op himself, 1 needs bind both http , https ports in iis , use configuration below.

            <service name="cxtmappingwebservice.cxtmappingwebservice" behaviorconfiguration="cxtmappingwebservice.cxtmappingwebservicebehavior">               <endpoint address="" bindingconfiguration="securehttpbinding" binding="basichttpbinding" contract="cxtmappingwebservice.icxtmappingwebservice" behaviorconfiguration="silverlightfaultbehavior" />               <endpoint address="" bindingconfiguration="basichttpbinding" binding="basichttpbinding" contract="cxtmappingwebservice.icxtmappingwebservice" behaviorconfiguration="silverlightfaultbehavior" />               <endpoint address="mex" binding="mexhttpbinding" contract="imetadataexchange" />             </service> 

that worked fine me!


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -