Groups | Blog | Home
all groups > dotnet xml > march 2004 >

dotnet xml : "Uses SOAP" COM+ Activation Setting Fails When Calling Method


Jonatan Kelu
3/16/2004 7:46:06 PM
Hmmm... Since I haven't yet got a reply, I'm guessing I must've stuffed up my previous post since this interface has changed. Oh well, here goes again..

I am using COM+. I have a simple component I made using Visual Studio 2003 attributed ATL. The component has a single interface, which I designated as the default interface. The interface is defined as follows


object
uuid("3E65DC52-DE6D-4483-91A1-1EAE37E0B375")
dual, helpstring("ICOMPlusWebService Interface")
pointer_default(unique

__interface ICOMPlusWebService : IDispatc

[helpstring("method GetString")] HRESULT GetString([in] BSTR strIn, [out,retval] BSTR* strOut)
}

The component is defined as follows


coclass
default(ICOMPlusWebService)
threading("neutral")
vi_progid("COMPlusWebServiceServer.COMPlusWebServi")
progid("COMPlusWebServiceServer.COMPlusWebSer.1")
version(1.0)
uuid("08FAF7C4-28BA-422F-8988-AE583B12AF73")
helpstring("COMPlusWebService Class"

class ATL_NO_VTABLE CCOMPlusWebService :
public ICOMPlusWebServic

public
CCOMPlusWebService(



DECLARE_PROTECT_FINAL_CONSTRUCT(

HRESULT FinalConstruct(

return S_OK


void FinalRelease()



public

STDMETHOD(GetString)(BSTR strIn, BSTR* strOut)
}

The implementation of its GetString() method is as follows (ie. it takes a string, prepends it with "Hello " and returns the result)

STDMETHODIMP CCOMPlusWebService::GetString(BSTR strIn, BSTR* strOut

tr

CAtlStringW str(L"Hello ")
str += strIn
*strOut = str.AllocSysString()
return S_OK

catch (...

return E_FAIL



I have tested that this component is automation compatible by creating a JScript file that calls it. The JScript file looks as follows

var server = WScript.CreateObject("COMPlusWebServiceServer.COMPlusWebSer.1")
var str = server.GetString("World!!!")
WScript.Echo(str)

When executed, this works fine - ie. displays the string "Hello World!!!"

I then configure my component inside a COM+ server application on Windows XP Service Pack 1. In Component Services, I right click on the COM+ application's properties, go to the "Activation" tab, and check "Uses SOAP". In the "SOAP VRoot:" field, I put COMPWS. This supposedly creates a Web Service wrapping up my COM component so I can call it remotely via a Web Services interface. Looking into IIS, I can see that there is now a new virtual directory called "COMPWS". This virtual directory contains the following files

Default.asp
Default.disc
Web.confi

In addition, it contains a subfolder called "bin" which contains the following file

COMPlusWebServiceServerSoapLib.dl

When I add a Web Reference to another (C#) project referring to this Web Service, the reference gets added OK and all the intellisense works fine, and it compiles properly. However, when I run it, I get the following error

Unhandled Exception: System.Web.Services.Protocols.SoapException: **** System.InvalidCastException - QueryInterface for interface COMPlusWebServiceServerSoapLib.ICOMPlusWebService failed

Also, I tried running the following JScript

var server = GetObject("soap:wsdl=http://localhost/COMPWS/COMPlusWebServiceServer.COMPlusWebSer.1.soap?WSDL";)
var str = server.GetString("World!!!")
WScript.Echo(str)

But I get the following error

Script: <Path to my script
Line:
Char:
Error: QueryInterface for interface COMPlusWebServiceServerSoapLib.ICOMPlusWebService failed
Code: 8000400
Source: COMPlusWebServiceServerSoapLi

ie. It seems to not be able to retrieve the COM component's default interface - ICOMPlusWebService. I thought it might be a security issue, so I set the COM+ application's "Authentication Level for Calls" to "None" and I ran the Permissions Wizard in IIS on the Virtual Directory to make the Virtual Directory publicly available. I ensured the "Directory Security" allows "Anonymous Access", and I even gave "Execute Permissions" to run "Scripts and Executables". But all to no avail - I keep getting the same error

Has anybody else run into this problem? Is it just my machine? Have I missed a configuration option somewhere that I need to set for this to work? Whatever the case may be, putting a Web Service wrapper on a COM+ configured component doesn't seem to be working for me and any help would be much appreciated

Thanks.
yhhuang NO[at]SPAM online.microsoft.com
3/17/2004 10:12:47 AM
Hello,

I noticed that the problem is also posted in
microsoft.public.mts.programming group. We will test it first and follow up
with more information there. If you have time, please check our reply in
that group and reply there. Thanks very much.

Best regards,
Yanhong Huang
Microsoft Community Support

Get Secure! ¨C www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
AddThis Social Bookmark Button