Question

Following is how the serviceModel configured in WCF's web.config:

<system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="basicHttpWithSecure">
          <security mode="TransportCredentialOnly">
            <transport clientCredentialType="Basic"></transport>
          </security>
        </binding>
      </basicHttpBinding>

    </bindings>
    <services>
      <service name="CMA.Customers">
        <endpoint name="basic" binding="basicHttpBinding" contract="CMA.Customers" bindingConfiguration="basicHttpWithSecure"></endpoint>
      </service>      
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpsGetEnabled="true" />
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="false" />          
        </behavior>
      </serviceBehaviors>
    </behaviors>

    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>

This service is deployed on IIS, and I can access it using the url - https://www.companyname.co.uk/sitename/wcfservicename/service.svc Authentication is set to "Anonymous", and "Basic" in IIS for this WCF.

Now I have an MVC application deployed on the same site, and I want to point that MVC site to consume this WCF. How can I configure it in web.config of my MVC site?

Or you think any change required in WCF's configurations to make it possible?

Was it helpful?

Solution

change your security mode :

<security mode="TransportCredentialOnly">

to

<security mode="Transport">

because TransportCredentialOnly is for http-based client authentication.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top