Testing SSL-Enabled WCF Services hosted in IIS with

In this scenario we'll test a wcf service that's hosted in IIS and is using SSL.

First, create the wcf service
  1. Open up Visual Studio and create a wcf service.
  2. Configure it with the following binding

    <basicHttpBinding>
       <binding name="basicBinding" >
        <security mode="Transport">
          <transport clientCredentialType="Windows" />
         </security>
      </binding>
     </basicHttpBinding>
  3. Add a ServiceMetadata behavior and set HttpsGetEnabled to true.
  4. Add a MEX endpoint to the service using mexHttpsBinding
  5. Using Visual Studio, "Publish" the service to IIS
Next, deploy the service to IIS
  1. Open up IIS (run inetmgr.exe)
  2. Navigate to the web site where the WCF service was published
  3. Enable "https" binding


     
  4. Select the published WCF service
  5. Open "SSL Settings"
  6. Set "Require SSL" to true and "Client certificates" to Ignore.
  7. Check that the WCF service can be viewed in internet explorer
Then test with WCFStorm
  1. Open up wcfstorm and Add the service
  2. Invoke a method and you'll get the error

    The provided URI scheme 'https' is invalid; expected 'http'.
    Parameter name: via

  3. To fix the error, generate a client config that matches the wcf service configuration.  The easiest way to do this is with Visual Studio.
       * Open Visual Studio and add a service reference to the service.  VS will generate an app.config file that
          matches the service
       * Edit the app.config file so that it can be read by wcfstorm. Please see Loading Client App.config files. Ensure that
          the endpoint/@name and endpoint/@contract attributes match the values in wcfstorm.
  4. Load the modified app,config to wcfstorm.
  5. Invoke the method.  This time the method invocation will no longer fail

Site Map | Printable View | © 2008 - 2018 WCFStorm Solutions

Powered by mojoPortal | XHTML 1.0 | CSS | Design by styleshout