none
ServiceHost only supports class service types? RRS feed

  • Question

  • I'm getting an error from the HpcServiceHost when I host my service (deployed through SOA debugger):

     

    [HpcServiceHost]: System.ArgumentException: ServiceHost only supports class service types.

       at System.ServiceModel.ServiceHost.CreateDescription(IDictionary`2& implementedContracts)

       at System.ServiceModel.ServiceHostBase.InitializeDescription(UriSchemeKeyedCollection baseAddresses)

       at System.ServiceModel.ServiceHost..ctor(Type serviceType, Uri[] baseAddresses)

       at Microsoft.Hpc.CcpServiceHosting.CcpServiceHostWrapper.RunInternal()

     

    Any ideas what this means? My service project is quite large, but it is a normal WCF project.

    Thursday, July 7, 2011 2:18 PM

All replies

  • Using the SOA debugger, it copies a config file to each one of the nodes in my cluster. The config file contains this section:

      <microsoft.Hpc.Session.ServiceRegistration>

        <service assembly="%tmp%\username\UI_EMEAWINWS046_3548\Services.CalculationProject\Services.CalculationProject.dll" />

      </microsoft.Hpc.Session.ServiceRegistration>

     

    What I have discovered, is that the part that is missing from the <service assembly /> line is:

      contract="Services.ICalculationService" type="Services.CalculationService"

     

    Without it, I get the error "HpcServiceHost only supports class service types". 

     

    How can I modify the config file that gets generated by the SOA debugger to also include this information (and possibly other settings I want in this file, such as controlling the brokers monitor behavior, or service addresses)?

    • Proposed as answer by mshojatalab Wednesday, December 7, 2016 9:56 AM
    Thursday, July 7, 2011 4:16 PM
  • Hi,

    Does your WCF service interface Services.ICalculationService has [ServiceContract] attibute and your service class Services.CalculationService implement this interface?

    Monday, July 11, 2011 3:16 AM
  • Hi,

    Yes it does. The funny thing is, when it was named IService1/Service1 it worked fine, and we of course changed the name to something more appropriate, and it didn't work. I don't know if the config file that gets generated by the SOA debugger ever contained the contract and type strings, though.

    Should the config file that gets generated by the SOA debugger be merged with the one in my project, or does it simply get replaced?

    Monday, July 11, 2011 9:45 AM
  • Hi Krolley,

    Could you confirm following things please?

    (1) You build the project after you change the class/interface name.

    (2) When you press F5, the SOA debugger deploys the generated service assembly to the shared folder specified by you. If you don't specify it, \\<Headnodename>\CcpSpoolDir\<YourAccountName> is the default folder.

    (3) Only have one interface with [ServiceContract] attribute in your service assembly. The HpcServiceHost.exe will automatically find it. So actually don't need to specify the contract in the config file. User can't edit the config file, which is generated by the SOA debugger. It is not supported now.

     
    I try to repro your issue. I change the name in this way, it works well for me.

    (1) Change the IService1 to IService123, change Service1 to Service123. You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together. Build the project.

    (2) In the client project, update the service reference. And change IService1 to IService123 in the client code.

    (3) Press F5 to start the SOA debugger.

    Tuesday, July 12, 2011 3:36 AM