Results 1 to 1 of 1

Thread: [RESOLVED] Multiple Sites on WCF Service

  1. #1

    Thread Starter
    Frenzied Member FishGuy's Avatar
    Join Date
    Mar 2005
    Location
    Bradford UK
    Posts
    1,708

    Resolved [RESOLVED] Multiple Sites on WCF Service

    Im having problems getting my WCF service to run with 3 possible domains http, https and www
    I can get it to work with any combination of just two but not all three at once.

    Currently I have it so I get to the service welcome page such as http://dev-site.ca/old/_Global/servi...ervice.svc.svc but as soon as I try to access the method i.e. http://dev-site.ca/old/_Global/servi....svc/websearch I hit a 404 error

    I'm pretty sure its going to be a web config issue but I just cant seem to get the right combination of bindings to satisfy all three domains

    Code:
     <system.serviceModel>
       
        <behaviors >
          <serviceBehaviors>
            <behavior name="GSAServiceBehavior">
              <serviceDebug includeExceptionDetailInFaults="false" httpHelpPageEnabled="True" />
              <serviceMetadata httpGetEnabled="True"/>
            </behavior>
          </serviceBehaviors>
          <endpointBehaviors>
            <behavior name="GSAEndpointBehavior">
              <webHttp />
            </behavior>
          </endpointBehaviors>
        </behaviors>
        <services >
          <service name="My.Google.Service.GSAService" behaviorConfiguration="GSAServiceBehavior">
            <endpoint address="/old/_Global/service/GSAService.svc" behaviorConfiguration="GSAEndpointBehavior" binding="webHttpBinding" contract="My.Google.Service.GSAService" />
            <endpoint address="/old/_Global/service/GSAService.svc" behaviorConfiguration="GSAEndpointBehavior" binding="webHttpBinding" bindingConfiguration="webBinding" contract="My.Google.Service.GSAService" />
          </service>
        </services>
        <serviceHostingEnvironment   multipleSiteBindingsEnabled="true">
          <baseAddressPrefixFilters >
            <add prefix="https://dev-site.ca" />
            <add prefix="http://dev-site.ca" />
          <add prefix="http://www.dev-site.ca" />
          </baseAddressPrefixFilters>
        </serviceHostingEnvironment>
      </system.serviceModel>
    /////////////////////////////////////////
    RESOLVED

    <serviceHostingEnvironment xdt:Transform="Replace" multipleSiteBindingsEnabled="true">
    <baseAddressPrefixFilters xdt:Transform="Replace">
    <add prefix="https://dev-site.ca" />
    <add prefix="http://dev-site.ca" />
    <add prefix="http://www.dev-site.ca" />
    </baseAddressPrefixFilters>
    </serviceHostingEnvironment>
    Last edited by FishGuy; Oct 19th, 2015 at 08:08 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width