I have read several articles that tell me that a COM+ application can expose
its components as web services, but can't get things to work for me.
I have the following class (slightly modified from one example I found) :
using System;
using System.EnterpriseServices;
using System.Xml;
using System.Runtime.InteropServices;
namespace MyMathClass
{
[Guid("2D0B6B56-8572-4f25-8B13-E5CF81783E77")]
[ComVisible(true)]
public interface ISimpleMath
{
Int32 DoAdd(Int32 Input1, Int32 Input2);
}
[Transaction(TransactionOption.Supported)]
[Guid("33933BDB-794D-4d3e-963A-D6FBCEE068E4")]
[ClassInterface(ClassInterfaceType.AutoDual)]
[ComVisible(true)]
public sealed class SimpleMath : ServicedComponent, ISimpleMath
{
public SimpleMath()
{
}
public Int32 DoAdd(Int32 Input1, Int32 Input2)
{
return Input1 + Input2;
}
}
}
This code compiles fine, I can register the assembly in the GAC, register
the component with regasm and then create the COM+ application (server
application).
Once I check the box under the activation tab of the application properties
and specify the vroot (CSSOAP) the web service appears in IIS.
Browsing to the web service (http://localhost/cssoap/) I get the expected
page with the link to the wsdl, but that's as far as things go. When I click
on the link I get the following error:
System.IO.FileNotFoundException: File or assembly name CSSoap, or one of its
dependencies, was not found.
File name: "CSSoap"
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String
codeBase, Boolean isStringized, Evidence assemblySecurity, Boolean
throwOnFileNotFound, Assembly locationHint, StackCrawlMark& stackMark)
at System.Reflection.Assembly.InternalLoad(AssemblyNa me assemblyRef,
Boolean stringized, Evidence assemblySecurity, StackCrawlMark& stackMark)
at System.Reflection.Assembly.InternalLoad(String assemblyString,
Evidence assemblySecurity, StackCrawlMark& stackMark)
at System.Reflection.Assembly.Load(String assemblyString)
at System.Runtime.Remoting.RemotingConfigInfo.LoadTyp e(String typeName,
String assemblyName)
at System.Runtime.Remoting.RemotingConfigInfo.GetServ erTypeForUri(String
URI)
at
System.Runtime.Remoting.RemotingConfigHandler.GetS erverTypeForUri(String URI)
at System.Runtime.Remoting.RemotingServices.GetServer TypeForUri(String URI)
at
System.Runtime.Remoting.Channels.Http.HttpRemoting Handler.CanServiceRequest(HttpContext context)
at
System.Runtime.Remoting.Channels.Http.HttpRemoting Handler.InternalProcessRequest(HttpContext context)
=== Pre-bind state information ===
LOG: DisplayName = CSSoap, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=5e5633b846f72f05
(Fully-specified)
LOG: Appbase = file:///C:/WINDOWS/system32/com/SOAPVRoots/CSSoap
LOG: Initial PrivatePath = bin
Calling assembly : (Unknown).
===
LOG: Publisher policy file is not found.
LOG: No redirect found in host configuration file
(c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\aspn et.config).
LOG: Using machine configuration file from
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\confi g\machine.config.
LOG: Post-policy reference: CSSoap, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=5e5633b846f72f05
LOG: Attempting download of new URL
file:///c:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/cssoap/5babd251/42e46353/CSSoap.DLL.
LOG: Attempting download of new URL
file:///c:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/cssoap/5babd251/42e46353/CSSoap/CSSoap.DLL.
LOG: Attempting download of new URL
file:///C:/WINDOWS/system32/com/SOAPVRoots/CSSoap/bin/CSSoap.DLL.
LOG: Attempting download of new URL
file:///C:/WINDOWS/system32/com/SOAPVRoots/CSSoap/bin/CSSoap/CSSoap.DLL.
LOG: Attempting download of new URL
file:///c:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/cssoap/5babd251/42e46353/CSSoap.EXE.
LOG: Attempting download of new URL
file:///c:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/cssoap/5babd251/42e46353/CSSoap/CSSoap.EXE.
LOG: Attempting download of new URL
file:///C:/WINDOWS/system32/com/SOAPVRoots/CSSoap/bin/CSSoap.EXE.
LOG: Attempting download of new URL
file:///C:/WINDOWS/system32/com/SOAPVRoots/CSSoap/bin/CSSoap/CSSoap.EXE.
Please can you tell me what I am doing wrong here?
The assembly was compiled in VS.NET 2005 on Windows XP Pro SP2.
I have checked the /bin folder for the web service and it is empty, however
I believe this is correct as the assembly is installed in the GAC and there
are no COM wrapper classes involved.
I look forward to getting a resolution for this quickly as we would like to
use this method to expose existing functionality as web services with the
least effort (time!).
Thanks,
--------------------------
Shaun Venus
emailid: sunevnuahs
domain: hotmail.com
--------------------------