none
Creating a service host without .svc or configuration RRS feed

  • Question

  • We have a framework where all entities and services are registered at Unity. So I would like to define my service hosts using a query in Unity and dynamically creating required hosts, without using .svc or any <serviceActivations> entry at config file.

    This feature is very important because the systems is fully modular, and each module defines its own services, but today I must declare all services at a single web.config file, containing the following declaration:

          <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true">
             <serviceActivations>
                <add service="XXX.Common.Geopolitical.CountrySvc" relativeAddress="Common/Geopolitical/Country.svc"/>
                <add service="XXX.Common.Geopolitical.CultureSvc" relativeAddress="Common/Geopolitical/Culture.svc"/>
                <add service="XXX.Common.Party.PersonSvc" relativeAddress="Common/Party/Person.svc"/>
             </serviceActivations>
          </serviceHostingEnvironment>

    All my services inherits the generic type: CrudService<Entity>. So my idea is hooking the system before the construction of the service hosts, query the container for all classes inheriting this one and create all service hosts, no matter in each module it was declared. But I do not want to use self hosted services. I want to host the services in IIS, as usual.

    May this be possible? 

    Tuesday, May 10, 2016 8:37 PM

Answers

  • May this be possible? 

    I don't think so. Your post subject has been posted before in the forum. You'll have to seek them out to see if there is a resolution, but I doubt it.

    Tuesday, May 10, 2016 11:00 PM
  • Hello,

    >>So I would like to define my service hosts using a query in Unity and dynamically creating required hosts, without using .svc or any <serviceActivations> entry at config file.

    It is possible to deploy a WCF Service in IIS Without an .svc File, we need to use the "simulate" .svc via using the <serviceActivations> at the config file.
    For more information, please check:
    https://blogs.msdn.microsoft.com/rampo/2009/10/26/activation-without-svc-files-config-based-activation-cba/ .

    But your requirement is to host the WCF in IIS without using the .svc and any <serviceActivations> entry at config file, then I agree with @DA924x, it is not possible.

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, May 13, 2016 5:19 AM
    Moderator

All replies

  • May this be possible? 

    I don't think so. Your post subject has been posted before in the forum. You'll have to seek them out to see if there is a resolution, but I doubt it.

    Tuesday, May 10, 2016 11:00 PM
  • Hello,

    >>So I would like to define my service hosts using a query in Unity and dynamically creating required hosts, without using .svc or any <serviceActivations> entry at config file.

    It is possible to deploy a WCF Service in IIS Without an .svc File, we need to use the "simulate" .svc via using the <serviceActivations> at the config file.
    For more information, please check:
    https://blogs.msdn.microsoft.com/rampo/2009/10/26/activation-without-svc-files-config-based-activation-cba/ .

    But your requirement is to host the WCF in IIS without using the .svc and any <serviceActivations> entry at config file, then I agree with @DA924x, it is not possible.

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, May 13, 2016 5:19 AM
    Moderator