简体   繁体   中英

WCF Activation exception - Base address for service not provided

ServiceActivationException: The service '//Service.svc' cannot be activated due to an exception during compilation. The exception message is: Base addresses for the services are not provided. Provide at least one base address.

I have provided base address in the web.config

<system.serviceModel>
<services>
  <service name="WFService.Service1" behaviorConfiguration="WFService.Service1Behavior">
    <endpoint name="json" address="http://localhost:3003/WFServiceHost/Service.svc/json" binding="webHttpBinding" bindingConfiguration="webHttpBindingConfig" contract="WFService.IService" behaviorConfiguration="WFServiceJsonEndpointBehavior"/>
    <host>
      **<baseAddresses>
        <add baseAddress="http://localhost:3003/WFServiceHost/Service.svc"/>
      </baseAddresses>**
    </host>
  </service>
</services>

In service.svc - I have Factory="System.ServiceModel.Activation.WorkflowServiceHostFactory"

Any idea, what the resolution for it?

baseAddress should not include Service.svc

    <system.serviceModel>
    <services>
      <service name="WFService.Service1" behaviorConfiguration="WFService.Service1Behavior">
        <endpoint name="json" address="json" binding="webHttpBinding" bindingConfiguration="webHttpBindingConfig" contract="WFService.IService" behaviorConfiguration="WFServiceJsonEndpointBehavior"/>
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:3003/WFServiceHost/"/>
          </baseAddresses>
        </host>
      </service>
    </services>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM