0
votes

I have a wcf service and following is the error i receive:

The HttpsGetEnabled property of ServiceMetadataBehavior is set to true and the HttpsGetUrl property is a relative address, but there is no https base address. Either supply an https base address or set HttpsGetUrl to an absolute address.

My web.config settings is as below :

<system.serviceModel>
<services>
  <service name="TBServiceProvider" behaviorConfiguration="ServiceBehaviour">
    <endpoint address="" binding="webHttpBinding"
              contract="ITBServiceProvider" behaviorConfiguration="web">
    </endpoint>
  </service>
</services>
<behaviors>
  <serviceBehaviors>
    <behavior name="ServiceBehaviour">
      <serviceMetadata httpsGetEnabled="false"/>
      <serviceDebug includeExceptionDetailInFaults="false" />
    </behavior>
  </serviceBehaviors>
  <endpointBehaviors>
    <behavior name="web">
      <webHttp/>
    </behavior>
  </endpointBehaviors>
</behaviors>

<serviceHostingEnvironment multipleSiteBindingsEnabled="true" >
  <baseAddressPrefixFilters>
    <add prefix="http://www.xyz.com:8000"/>
  </baseAddressPrefixFilters>
</serviceHostingEnvironment>

The above settings work perfectly fine on localhost, but when it is uploaded to the server, the above mentioned error occurs. Please let me know what can be done to make the service work on hosting server.

Thanks

2
Where do you host your service ? IIS or windows service ?Rom Eh
The service is placed on a shared hosting server, over IIS.Sunny Shiny

2 Answers

0
votes

In IIS, base address prefix is not needed. You can delete this parameter.

Then you should replace httpsGetEnabled by httpGetEnabled. You don't need to specify httpsGetEnabled, if you don't expose your service on TLS.

Finally, can you add a screenshot of your service displayed in Internet Explorer on your server, and on a remote computer.

0
votes

Update in web.config file

 <system.serviceModel>
 <behaviors>
  <serviceBehaviors>
    <behavior name="">
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="false" />
    </behavior>
  </serviceBehaviors>
  <endpointBehaviors>
    <behavior name="Web">
      <webHttp/>
    </behavior>
  </endpointBehaviors>
</behaviors>
<bindings>
  <webHttpBinding>
    <binding>
      <security mode="None" />
    </binding>
  </webHttpBinding>
</bindings>
<services>
  <service name="TBSERVICe">
    <endpoint address=""
              binding="webHttpBinding"
              behaviorConfiguration="Web"
              contract="ITBSERVICE" />
  </service>
</services>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>

Addition in TBSERVICE.svc file

    Factory="System.ServiceModel.Activation.WebServiceHostFactory"

These mentioned settings worked well for hosting webservice on server. My issue was also regarding the files are not updated when any changes are made on them, ie project files like .svc and web.config were still accepted from some temporary storage by hosting server. Would always prefer to place on atleast 2 servers then.

Thanks