I am working with a client that has multiple Classic ASP websites, but would like to use AppFabric Caching within these sites to help lighten the load they currently have on their database.
The first approach we used was creating a .NET wrapper for the AppFabric API and exposing it to the ASP websites as a COM object. This method worked, but they soon began to experience high memory usage that crashed their webserver. The COM component is hosted within the application scope of the site so that could be a big part of the issue.
One of the options I came up with was creating a WCF Service and exposing it to the ASP sites as a COM+ Service. Unfortunately, my exposure to COM+ at this point is limited. My reasoning behind this is the service can be utilized from the ASP websites, but hosted out of process from the websites. This would also allow me to performance test the COM+ service independently from the websites.
I am having trouble coming up with start to finish documentation for creating and publishing the COM+ service. The MSDN documentation I’ve read appears to skip significant steps in the process.
As an example service I have the following:
namespace TestComService
{
[ServiceContract(SessionMode = SessionMode.Allowed, Namespace = "http://tempure.org/DD1F6C46-1A25-49CC-AA20-2D31A3D0C0AA", Name = "IService")]
public interface IServiceContract
{
[OperationContract]
string Get(string key);
[OperationContract]
void Set(string key, string value);
}
public class Service : IServiceContract
{
private readonly Dictionary<string, string> cache = new Dictionary<string, string>();
public string Get(string key)
{
return cache[key];
}
public void Set(string key, string value)
{
cache.Add(key, value);
}
}
}
The configuration is as follows:
<system.serviceModel>
<bindings>
<netNamedPipeBinding>
<binding name="comNonTransactionalBinding"/>
</netNamedPipeBinding>
</bindings>
<comContracts>
<comContract contract="{DD1F6C46-1A25-49CC-AA20-2D31A3D0C0AA}" name="IService" namespace="http://tempure.org/DD1F6C46-1A25-49CC-AA20-2D31A3D0C0AA" requiresSession="true">
<exposedMethods>
<add exposedMethod="Get"/>
<add exposedMethod="Set"/>
</exposedMethods>
</comContract>
</comContracts>
<services>
<service name="{3957AA9E-4671-4EF0-859B-1E94F9B21BEE},{5D180F85-65D8-4C0C-B5D6-9D28C59E29AE}">
<endpoint address="IService" binding="netNamedPipeBinding" bindingConfiguration="comNonTransactionalBinding" contract="{DD1F6C46-1A25-49CC-AA20-2D31A3D0C0AA}"/>
<host>
<baseAddresses>
<add baseAddress="net.pipe://localhost/TestComService"/>
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>
I’m still a bit confused as far as hosting goes. Can this be hosted within IIS, or to I need to create a separate service to host within that?
Once again, I'm open to any suggestions or input someone with more experience with the matter can provide.