I'm trying to deploy a WCF service to my server, hosted in IIS. Naturally it works on my machine :)
But when I deploy it, I get the following error:
This collection already contains an address with scheme http. There can be at most one address per scheme in this collection.
Googling on this, I find that I have to put a serviceHostingEnvironment element into the web.config file:
<serviceHostingEnvironment> <baseAddressPrefixFilters> <add prefix="http://mywebsiteurl"/> </baseAddressPrefixFilters> </serviceHostingEnvironment>
But once I have done this, I get the following:
Could not find a base address that matches scheme http for the endpoint with binding BasicHttpBinding. Registered base address schemes are [https].
It seems it doesn't know what the base address is, but how do I specify it? Here's the relevant section of my web.config file:
<system.serviceModel> <serviceHostingEnvironment> <baseAddressPrefixFilters> <add prefix="http://mywebsiteurl"/> </baseAddressPrefixFilters> </serviceHostingEnvironment> <behaviors> <serviceBehaviors> <behavior name="WcfPortalBehavior"> <serviceMetadata httpGetEnabled="true"/> <serviceDebug includeExceptionDetailInFaults="true"/> </behavior> </serviceBehaviors> </behaviors> <bindings> <basicHttpBinding> <binding name="BasicHttpBinding_IWcfPortal" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" receiveTimeout="00:10:00" sendTimeout="00:10:00" openTimeout="00:10:00" closeTimeout="00:10:00"> <readerQuotas maxBytesPerRead="2147483647" maxArrayLength="2147483647" maxStringContentLength="2147483647"/> </binding> </basicHttpBinding> </bindings> <services> <service behaviorConfiguration="WcfPortalBehavior" name="Csla.Server.Hosts.Silverlight.WcfPortal"> <endpoint address="" binding="basicHttpBinding" contract="Csla.Server.Hosts.Silverlight.IWcfPortal" bindingConfiguration="BasicHttpBinding_IWcfPortal"> </endpoint> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/> </service> </services> </system.serviceModel>
Can anybody shed some light on what's going on and how to fix it?
You need to create the SSL certificate in IIS server. 2. In IIS, you need add https binding (SSL) and select the certificate that you created in 1 step..
WSHttpBinding(SecurityMode, Boolean) Initializes a new instance of the WSHttpBinding class with a specified type of security used by the binding and a value that indicates whether a reliable session is enabled.
Try changing the security mode from "Transport" to "None".
<!-- Transport security mode requires IIS to have a certificate configured for SSL. See readme for more information on how to set this up. --> <security mode="None">
I had to do two things to the IIS configuration of the site/application. My issue had to do with getting net.tcp working in an IIS Web Site App:
First:
Second:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With