Reputation: 6858
I have followed the MSDN site for creating a https site for a WCF (4.5, using simplified configuration) web service https://msdn.microsoft.com/en-us/library/hh556232(v=vs.110).aspx
When I navigate to my website of http
or https
. It is showing me the landing page fine (the one that says 'you have created a service' and points you to the wsdl, etc), so I know my certificates are ok.
However, the link displayed in the web service landing page to find the wsdl is showing as http://
and not https://
and when I try and navigate to https://example.com?singleWsdl
all I get is the same welcome page and not the wsdl.
All is fine with http
.
Here is the entries I changed to support https
. Is there anything else I need to do? I made no code changes.
<basicHttpBinding>
<binding name="HttpBinding" maxBufferPoolSize="2147483647"
maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647" messageEncoding="Text">
<readerQuotas maxDepth="2000000"
maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647"
/>
</binding>
<binding name="HttpsBinding" maxBufferPoolSize="2147483647"
maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text">
<security mode="Transport">
<transport clientCredentialType="None" />
</security>
<readerQuotas maxDepth="2000000"
maxStringContentLength="2147483647"
maxArrayLength="2147483647"
maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"
/>
</binding>
</basicHttpBinding>
<protocolMapping>
<add scheme="http" binding="basicHttpBinding" bindingConfiguration="HttpBinding" />
<add scheme="https" binding="basicHttpBinding" bindingConfiguration="HttpsBinding" />
</protocolMapping>
thanks.
Upvotes: 1
Views: 2708
Reputation: 199
What do your endpoints look like? I believe for https, you would need an mexHttpsBinding endpoint. Something like:
<endpoint address="mex" binding="mexHttpsBinding" name="MexHttpsBindingEndpoint" contract="IMetadataExchange" />
Upvotes: 0
Reputation: 458
What about activating ServiceMetadata
with this parameter ?
<serviceBehaviors>
...
<serviceMetadata httpsGetEnabled="true"/>
...
</serviceBehaviors>
Source : https://msdn.microsoft.com/en-us/library/ms731317(v=vs.110).aspx#Anchor_1
Check out the end of their exemple (I cannot seems to put it as a quote)
Upvotes: 3