How to set base address for WCF in IIS

I have a web service that works on my local machine but I am unable to deploy on my remote IIS server.  This is frustrating b/c for a month I had it working, and then I made some changes that broke it.  Can't figure out where.

If I start the web service on my local machine, and then start another VS instance of my client on my local machine, the client connects to the web service and returns proper results. When I move to IIS on remote server, I continually get the 'no endpoint listening...' error msg. I can't build a service reference.  I clearly don't have the right base address that will match the client.
On the client, I have a FQDN like this:
 <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="GridviewEndpoint" />
      </basicHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://arrowswebservice.loyaltybuilders.com/Service1.svc"
          binding="basicHttpBinding" bindingConfiguration="GridviewEndpoint"
          contract="AmzArrows9WS.IService1" name="GridviewEndpoint" />
    </client>
  </system.serviceModel>

Open in new window


On the server, the relevant section of web.config is
<system.serviceModel>
    <services>
      <service name="Arrows9WS.Service1" behaviorConfiguration="metadataBehavior">       
        <host>
             <baseAddresses>
                 <add baseAddress="http://arrowswebservice.loyaltybuilders.com/Service1.svc"/>
             </baseAddresses>
        </host>
          <endpoint 
            address="" 
            binding="basicHttpBinding" 
            name="GridviewEndpoint" 
            contract="Arrows9WS.IService1" />
         <endpoint 
            address="mex" 
            binding="mexHttpBinding" 
            contract="IMetadataExchange"/>  
    </service>
    </services>
    <client>
      <endpoint
            address=""
            behaviorConfiguration="webEndpoint"
            binding="basicHttpBinding"
            bindingConfiguration="ArrowsBasicHttpBinding"
            contract="Arrows9WS.IService1"
            name="GridviewEndpoint" />    
    </client>
    <behaviors>
      <serviceBehaviors>
        <behavior name="metadataBehavior">
          <!-- To avoid disclosing metadata information, set the values below to false before deployment -->
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" httpGetUrl=""/>
          <!-- 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="true"/>
       </behavior> 
       <!--<behavior>
         <useRequestHeadersForMetadataAddress/>
       </behavior> -->
      </serviceBehaviors>
      <endpointBehaviors>
        <behavior name="webBehaviour">
          <webHttp/>
        </behavior>
        <behavior name="webEndpoint">
            <webHttp defaultBodyStyle="Wrapped" defaultOutgoingResponseFormat="Xml" 
                helpEnabled="true"/>
        </behavior>
      </endpointBehaviors>
    </behaviors>
    <bindings>
      <basicHttpBinding>
        <binding name="ArrowsBasicHttpBinding" />
      </basicHttpBinding>
    </bindings>
    <protocolMapping>
        <add binding="basicHttpsBinding" scheme="https" />
    </protocolMapping>    
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
  </system.serviceModel>

Open in new window


It's entirely possible that the problems are in how I've set up the web service web site on IIS, especially the bindings, rather than in the code for the web service itself, given the success of my local test.  How crucial are the port settings in the bindings?
When I test, I try to access the web service on IIS from my local client, unsuccessfully.
Mark KleinAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Aaron JabamaniTechnical ArchitectCommented:
In the server you have any firewall in between ?
Mark KleinAuthor Commented:
Not a firewall issue.  I've tried w/ and w/o the firewall on, same response.  Also, it gets through, but doesn't find an appropriate endpoint. Something is wrong, perhaps binding or contract.
Aaron JabamaniTechnical ArchitectCommented:
What is the error you are getting ? can i browse the service via IE browser ?
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

Mark KleinAuthor Commented:
I am working to be able to browse the service myself. I created a small default.html file and have been trying to produce it with the url http://arrowswebservice.loyaltybuilders.com/default.html

I removed the web.config, got the test page, and have been putting back the web.config piece by piece while testing for the html page.  Found some offending code, can now produce the test page, but can't browse the service. Config file includes
 <directoryBrowse enabled="true"/>
I am attaching most of the config file.
<appSettings>
    <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
  </appSettings>
  <system.web>
    <compilation debug="true" targetFramework="4.5" />
    <httpRuntime targetFramework="4.5"/>
  </system.web>
  <system.webServer>
  <!--might be the problem
    <modules runAllManagedModulesForAllRequests="true"/> -->
    <!--
        To browse web app root directory during debugging, set the value below to true.
        Set to false before deployment to avoid disclosing web app folder information.
      -->
    <directoryBrowse enabled="true"/>
  </system.webServer>
  <system.serviceModel>
    <services>
      <service name="Arrows9WS.Service1" behaviorConfiguration="metadataBehavior">
        <host>
          <baseAddresses>
            <add baseAddress="http://arrowswebservice.loyaltybuilders.com/Service1.svc"/>
          </baseAddresses>
        </host>
        <endpoint
          address=""
          binding="basicHttpBinding"
          name="GridviewEndpoint"
          contract="Arrows9WS.IService1" />
        <endpoint
           address="mex"
           binding="mexHttpBinding"
           contract="IMetadataExchange"/>
      </service>
    </services>
    <client>
      <endpoint
            address=""
            behaviorConfiguration="webEndpoint"
            binding="basicHttpBinding"
            bindingConfiguration="ArrowsBasicHttpBinding"
            contract="Arrows9WS.IService1"
            name="GridviewEndpoint" />
    </client>
    <behaviors>
      <serviceBehaviors>
        <behavior name="metadataBehavior">
          <!-- To avoid disclosing metadata information, set the values below to false before deployment -->
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" httpGetUrl=""/>
          <!-- 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="true"/>
        </behavior>
        <!--<behavior>
         <useRequestHeadersForMetadataAddress/>
       </behavior> -->
      </serviceBehaviors>
      <endpointBehaviors>
        <behavior name="webBehaviour">
          <webHttp/>
        </behavior>
        <behavior name="webEndpoint">
          <webHttp defaultBodyStyle="Wrapped" defaultOutgoingResponseFormat="Xml"
              helpEnabled="true"/>
        </behavior>
      </endpointBehaviors>
    </behaviors>
    <bindings>
      <basicHttpBinding>
        <binding name="ArrowsBasicHttpBinding" />
      </basicHttpBinding>
    </bindings>
    <protocolMapping>
      <add binding="basicHttpsBinding" scheme="https" />
    </protocolMapping>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
  </system.serviceModel>

Open in new window

I need to be able to build a ServiceReference, but can't make the connection from my client to do so. I suspect that if I can get the directory browse working, I'll be able to make that connection.
Mark KleinAuthor Commented:
here's the error I'm now getting:
Could not load file or assembly 'Arrows9WS' or one of its dependencies. An attempt was made to load a program with an incorrect format.
Aaron JabamaniTechnical ArchitectCommented:
Enable tracing in wcf service https://msdn.microsoft.com/en-us/library/ms733025(v=vs.110).aspx 
 It will give more details about the error.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Mark KleinAuthor Commented:
got it working.  Errors in web.config were the wrong setting for aspcompatibility. In build, needed to choose 'anycpu'.Also needed a virtual directory cleanup.
Thanks for your help.  --mark
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
WCF

From novice to tech pro — start learning today.