PDA

View Full Version : Activating Serviced Components



crises
10-12-2005, 06:00 PM
hi,
im new to spring.net and trying to just initially use interface based programming using spring.net as a service locator.. ie i reference to an Interface and spring get me some basic classes. i know this isnt the intention of IoC and spring..

the problem i have found is calling a ServicedComponent. In ServicedComponentFactory.cs function AfterPropertiesSet() in spring.net uses Type.GetTypeFromProgID(string Name,string Server);

This function is not compatible with .NET namespace names but only works with COM program Id's so .NET ServicedComponents return null here and the Activator.CreateInstance fails.

My basic config is a follows:

<object id="DBConnect" type="DBConnectivity">
</object>

<object id="EnterpriseDBConnectivity"
type="Spring.Enterprise.ServicedComponentFactory, Spring.Services">
<property name="Name"><value>DataServices</value></property>

<property name="Template"><value>DBConnect</value></property>

</object>

DataServices would be my ServicedComponent, an i missing something here, do i need to use the EnterpriseServicesExporter instead of manually adding my COM+ app?

Thanks
Crises

Thanks
Crises

Aleks Seovic
10-21-2005, 06:22 AM
You don't need to use exporter, but you need to make sure that your component's COM+ name matches the ProgID that is specified as the value of the Name property of ServicedComponentFactory.

- Aleks