web services - Make WCF webservice available over http and https using basicHttpsBinding -



web services - Make WCF webservice available over http and https using basicHttpsBinding -

i'm trying create webservice available on http , https, i'm running error:

a kid element named 'endpoint' same key exists @ same configuration scope. collection elements must unique within same configuration scope (e.g. same application.config file). duplicate key value: 'address:;bindingconfiguration;bindingname:;bindingnamespace:;bindingsectionname:basichttpsbinding;contracttype:restservice.iservice;kind:;endpointconfiguration:;'.

now, that's clear error, don't know how alter configuration back upwards http , https requests on same contract. notice wish utilize wcf4.5 basichttpsbinding configuration.

here's configuration:

<system.servicemodel> <servicehostingenvironment aspnetcompatibilityenabled="true" multiplesitebindingsenabled="true" /> <services> <service name="restservice.service"> <!-- <host> <baseaddresses> <add baseaddress = "http://www.nl/service.svc/" /> <add baseaddress = "https://www.nl/service.svc/" /> </baseaddresses> </host> --> <endpoint binding="webhttpbinding" contract="restservice.iservice" /> <endpoint binding="webhttpbinding" address="" bindingconfiguration="webhttpbindingwithjsonp" name="restservice.iservice" contract="restservice.iservice"> </endpoint> <endpoint binding="basichttpsbinding" contract="restservice.iservice" /> <endpoint binding="basichttpsbinding" address="" name="restservice.iservice" contract="restservice.iservice"> </endpoint> </service> </services> <bindings> <webhttpbinding> <binding name="webhttpbindingwithjsonp" crossdomainscriptaccessenabled="true"> </binding> </webhttpbinding> <basichttpsbinding> <binding name="webhttpsbindingwithjsonp"> <security mode="transport"></security> </binding> </basichttpsbinding> </bindings> <behaviors> <servicebehaviors> <behavior name=""> <servicemetadata httpgetenabled="true" httpsgetenabled="true" /> <servicedebug includeexceptiondetailinfaults="true" /> </behavior> </servicebehaviors> <endpointbehaviors> <behavior name="webhttp"> <webhttp /> </behavior> <behavior name="webhttpbehavior"> <webhttp /> </behavior> </endpointbehaviors> </behaviors> </system.servicemodel>

in endpoints, need set binding of json endpoints webhttpbinding, not basichttpbinding. secured endpoint, you'll need add together binding configuration , set security mode transport.

also, please set address either web/basic endpoint. i'm pretty sure cannot utilize 2 bindings same address.

lastly, since hosted under iis, can remove baseaddress section not required. , create sure web site in iis configured back upwards http , https protocols (check through web site's bindings dialog in iis manager)

web-services wcf http https

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -