none
WCF web service not working with https RRS feed

  • Question

  • I've written a WCF service in VB.NET. When the service is called as http it works fine. However, when we change the url to https the calls to the web method falls over with the following error: "There was no endpoint listening at [url] that could accept the message. This is often caused by an incorrect address or SOAP action."


    Other threads say the remedy is to add <security mode="Transport"> to the configs (both client and server), which we've tried but the error still occurs.

    Does anyone have a remedy please?

    Client config is:

    <configuration>
      <startup>
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
      </startup>
      <system.serviceModel>
        <bindings>
          <basicHttpBinding>
            <binding name="BasicHttpBinding_ISmartPropertyHubServices" />

            <binding name="httpsBinding" allowCookies="true" maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647">
              <readerQuotas maxDepth="2147483647"
                            maxStringContentLength="2147483647"
                            maxArrayLength="2147483647"
                            maxBytesPerRead="2147483647"
                            maxNameTableCharCount="2147483647" />
              <security mode="Transport">
                <transport clientCredentialType="None" />
              </security>
            </binding>
          </basicHttpBinding>
        </bindings>
        <client>
          <endpoint address="xxxxxxxxxxx.svc"
              binding="basicHttpBinding" bindingConfiguration="httpsBinding"
              contract="wsHubServices.IHubServices" name="httpsBinding" />
        </client>

      </system.serviceModel>
    </configuration>

    Server config is:

    <configuration>


    <system.serviceModel>
        <bindings>
          <basicHttpBinding>
            <binding name="secureHttpsBinding">
              <security mode="Transport">
                <transport clientCredentialType="None"/>
              </security>
            </binding>
          </basicHttpBinding>
        </bindings>

        <services>
          <service
            name="ISmartPropertyHubServices">

            <endpoint address=""
                      binding="basicHttpBinding"
                      bindingConfiguration="secureHttpsBinding"
                      contract="Smart_Property_Hub_Services.ISmartPropertyHubServices" />

            <endpoint address="mex"
                      binding="mexHttpsBinding"
                      contract="IMetadataExchange" />
          </service>
        </services>

        <behaviors>
          <serviceBehaviors>
            <behavior>

              <serviceMetadata httpsGetEnabled="true" />

              <serviceDebug includeExceptionDetailInFaults="false" />
            </behavior>
          </serviceBehaviors>
        </behaviors>
        <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
      </system.serviceModel>
      <system.webServer>
        <modules runAllManagedModulesForAllRequests="true" />
      </system.webServer>
    </configuration>

    • Moved by Amanda Zhu Friday, May 30, 2014 6:02 AM
    Thursday, May 29, 2014 9:56 AM

Answers

  • Hi,

    From your description, I know that you wan to make the WCF to use the Https, then it will need some other configuration, for more information, please try to check the following:

    The HTTPS transport security requires an SSL certificate to be registered with IIS. If we do not have an SSL certificate we can use IIS to generate a test certificate. Next we must add an SSL binding to the web site and configure the web site’s authentication properties. Finally we need to configure the WCF service to use the HTTPS.

    For more information, please try to refer to:
    #How to: Configure an IIS-hosted WCF service with SSL:
    http://msdn.microsoft.com/en-us/library/hh556232(v=vs.110).aspx .

    #Seven simple steps to enable HTTPS on WCF :
    http://www.codeproject.com/Articles/36705/simple-steps-to-enable-HTTPS-on-WCF-WsHttp-bindi .


    Best Regards,
    Amy Peng

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Friday, May 30, 2014 8:04 AM
    Moderator

All replies

  • Hi,

    I moved this thread to Windows Communication Foundation, Serialization, and Networking  forum for better support.

    Best regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, May 30, 2014 6:03 AM
  • Hi,

    From your description, I know that you wan to make the WCF to use the Https, then it will need some other configuration, for more information, please try to check the following:

    The HTTPS transport security requires an SSL certificate to be registered with IIS. If we do not have an SSL certificate we can use IIS to generate a test certificate. Next we must add an SSL binding to the web site and configure the web site’s authentication properties. Finally we need to configure the WCF service to use the HTTPS.

    For more information, please try to refer to:
    #How to: Configure an IIS-hosted WCF service with SSL:
    http://msdn.microsoft.com/en-us/library/hh556232(v=vs.110).aspx .

    #Seven simple steps to enable HTTPS on WCF :
    http://www.codeproject.com/Articles/36705/simple-steps-to-enable-HTTPS-on-WCF-WsHttp-bindi .


    Best Regards,
    Amy Peng

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Friday, May 30, 2014 8:04 AM
    Moderator