简体   繁体   中英

https not showing wsdl page (WCF)

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.

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)

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" />

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM