1

I am new to WCF and have been having an issue with having my WCF service behind f5 showing the correct URLs (with the public hostname) in the WSDL. The request is going through the following path: Client ---(HTTPS)---> F5 ---(HTTPS)---> WebFacingServer ---(HTTP)---> ApplicationServer. The https certificate offloading will take place in the web facing server and send the request to the application server using HTTP. My WCF needs to be deployed in the application server and a client outside should be able to reach it via https://myPublicDomain.com/myServiceApp/service.svc I deployed the service in application server on http and used basichttpbinding endpoint.. Below is my Web.config for the service:

  <system.serviceModel>
    <serviceHostingEnvironment>
      <serviceActivations>
        <add factory="System.ServiceModel.Activation.ServiceHostFactory"
             relativeAddress="ServiceSoap.svc"
             service="MyAppNameService.Service" />
      </serviceActivations>
    </serviceHostingEnvironment>
    <services>
      <service name="MyAppNameService.Service">
        <endpoint address="" binding="basicHttpBinding" contract="MyAppNameService.IService">
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="https://MyPublicDomain.com/MyAppNameGateWay/ServiceSoap.svc" />
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug httpHelpPageEnabled="false" includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>

When calling the WSDL from outside using the puclic domain with HTTPS (https://MyPublicDomain.com/MyAppNameGateWay/ServiceSoap.svc?WSDL) I can see the WSDL but URLs in the WSDL are with the actual machine name. I tried using:

  <useRequestHeadersForMetadataAddress>
        <defaultPorts>
            <add scheme="http" port="80" />
            <add scheme="https" port="443" />
        </defaultPorts>
  </useRequestHeadersForMetadataAddress>

that resulted the URLs to show the hostname WebfacingServer is using to rout requests to ApplicationServer not the public domain that is hitting f5 (MyPublicDomain.com).

I also tried to configure the address of the endpoint with https://MyPublicDomain.com/MyAppNameGateWay/ServiceSoap.svc and added

<serviceMetadata httpGetEnabled="true" httpGetUrl="https://MyPublicDomain.com/MyAppNameGateWay/ServiceSoap.svc" />

but that resulted an error:

HttpGetUrl must be a relative URI or an absolute URI with scheme 'http'. 'https://MyPublicDomain.com/MyAppNameGateWay/ServiceSoap.svc' is an absolute URI with scheme 'https'.

I can't use httpsGetUrl because the request is coming as http so if I make it httpsGetUrl it will be useless.

I ran out of ideas.. I would appreciate if anyone knows how to cinfigure the service so clients outside will see URLs in the WSDL with the public domain name not any machine names or internal hostnames.

0 Answers0