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.Enterpri seServices;
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(Tra nsactionOption. Supported)]
[Guid("33933BDB-794D-4d3e-963A-D6FBCEE068E4")]
[ClassInterface( ClassInterfaceT ype.AutoDual)]
[ComVisible(true )]
public sealed class SimpleMath : ServicedCompone nt, 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.FileN otFoundExceptio n: File or assembly name CSSoap, or one of its
dependencies, was not found.
File name: "CSSoap"
at System.Reflecti on.Assembly.nLo ad(AssemblyName fileName, String
codeBase, Boolean isStringized, Evidence assemblySecurit y, Boolean
throwOnFileNotF ound, Assembly locationHint, StackCrawlMark& stackMark)
at System.Reflecti on.Assembly.Int ernalLoad(Assem blyName assemblyRef,
Boolean stringized, Evidence assemblySecurit y, StackCrawlMark& stackMark)
at System.Reflecti on.Assembly.Int ernalLoad(Strin g assemblyString,
Evidence assemblySecurit y, StackCrawlMark& stackMark)
at System.Reflecti on.Assembly.Loa d(String assemblyString)
at System.Runtime. Remoting.Remoti ngConfigInfo.Lo adType(String typeName,
String assemblyName)
at System.Runtime. Remoting.Remoti ngConfigInfo.Ge tServerTypeForU ri(String
URI)
at
System.Runtime. Remoting.Remoti ngConfigHandler .GetServerTypeF orUri(String URI)
at System.Runtime. Remoting.Remoti ngServices.GetS erverTypeForUri (String URI)
at
System.Runtime. Remoting.Channe ls.Http.HttpRem otingHandler.Ca nServiceRequest (HttpContext context)
at
System.Runtime. Remoting.Channe ls.Http.HttpRem otingHandler.In ternalProcessRe quest(HttpConte xt context)
=== Pre-bind state information ===
LOG: DisplayName = CSSoap, Version=1.0.0.0 , Culture=neutral ,
PublicKeyToken= 5e5633b846f72f0 5
(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\Mic rosoft.NET\Fram ework\v1.1.4322 \aspnet.config) .
LOG: Using machine configuration file from
C:\WINDOWS\Micr osoft.NET\Frame work\v1.1.4322\ config\machine. config.
LOG: Post-policy reference: CSSoap, Version=1.0.0.0 , Culture=neutral ,
PublicKeyToken= 5e5633b846f72f0 5
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
--------------------------