ServiceHost only supports class service types?
-
2011년 7월 7일 목요일 오후 2:18
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.
모든 응답
-
2011년 7월 7일 목요일 오후 4:16
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)?
-
2011년 7월 11일 월요일 오전 3:16
Hi,
Does your WCF service interface Services.ICalculationService has [ServiceContract] attibute and your service class Services.CalculationService implement this interface?
-
2011년 7월 11일 월요일 오전 9:45
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?
-
2011년 7월 12일 화요일 오전 3:36
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.