DazManCat
DazManCat

Reputation: 3630

Getting 404 from WCF webservice over HTTPS

I've been having fun and games dealing with WCF over SSL and load balancing :(

Current stand point is that it would seem we get to the server but it doesnt like the end point in thbe config.

Can any one advise?

Client config.

<system.serviceModel>
        <bindings>
            <basicHttpBinding>
                <binding name="BasicHttpBinding_IWorkflowAPI" closeTimeout="00:01:00"
                    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                    allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                    maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                    messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
                    useDefaultWebProxy="true">
                    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                    <security mode="TransportWithMessageCredential">
                        <transport clientCredentialType="None" proxyCredentialType="None"
                            realm="" />
                        <message clientCredentialType="UserName" algorithmSuite="Default" />
                    </security>
                </binding>
            </basicHttpBinding>
        </bindings>
        <client>
            <endpoint address="https://ourserver.com/API/workflow.svc" binding="basicHttpBinding"
                bindingConfiguration="BasicHttpBinding_IWorkflowAPI" contract="Warms.IWorkflowAPI"
                name="BasicHttpBinding_IWorkflowAPI" />
        </client>
    </system.serviceModel>

Webservice web config.

 <system.serviceModel>
  <behaviors>
    <serviceBehaviors>
      <behavior name="">
        <serviceMetadata httpGetEnabled="true" />
        <serviceDebug includeExceptionDetailInFaults="false" />
      </behavior>
      <behavior name="Originator Secured">
        <serviceMetadata httpGetEnabled="true" />
        <serviceDebug includeExceptionDetailInFaults="true" />
        <serviceCredentials>
          <userNameAuthentication userNamePasswordValidationMode="Custom" />
        </serviceCredentials>
      </behavior>
    </serviceBehaviors>
  </behaviors>
  <services>
    <service name="xx.xx.Web.UI.API.Workflow" behaviorConfiguration="Originator Secured">
      <endpoint address="https://ourserver/API/workflow.svc" binding="basicHttpBinding"
      bindingConfiguration="BasicHttpBinding_IWorkflowAPI" contract="xx.xx.Web.UI.API.IWorkflowAPI"
      name="BasicHttpBinding_IWorkflowAPI"  listenUri="/" />
    </service>
  </services>
  <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  <bindings>
    <basicHttpBinding>
           <binding name="BasicHttpBinding_IWorkflowAPI" closeTimeout="00:01:00"
                        openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                        allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                        maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                        messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
                        useDefaultWebProxy="true">
        <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
            maxBytesPerRead="4096" maxNameTableCharCount="16384" />
        <security mode="TransportWithMessageCredential">
          <transport clientCredentialType="None" proxyCredentialType="None"
              realm="" />
          <message clientCredentialType="UserName" algorithmSuite="Default" />
        </security>
      </binding>
    </basicHttpBinding>
    <wsHttpBinding>
      <binding name="Workflow API Binding">
        <security mode="TransportWithMessageCredential">
          <transport clientCredentialType="None" />
          <message clientCredentialType="UserName" />
        </security>
      </binding>
    </wsHttpBinding>
    <customBinding>
      <binding name="CustomHttpBinding">
        <security allowInsecureTransport="True">
        </security>
        <httpTransport />
      </binding>
    </customBinding>
  </bindings>
</system.serviceModel>

Upvotes: 1

Views: 1483

Answers (1)

James McLachlan
James McLachlan

Reputation: 1368

Perhaps your load balancer is not using SSL for its connection to the real web servers. Once you enable transport security your WCF service won't respond on port 80, only on 443. I think your options are: 1. to have the load balancer renegotiate SSL between itself and the web servers 2. leave transport security off in your WCF config and use only message security, leaving SSL for the load balancer to do.

Upvotes: 3

Related Questions