initialize COM within a web service

P

POnfri

I'm currently trying to use API's in Microsoft Virtual Server 2005. I can
initialize COM just fine from anything other then a web service whihc is were
i would like to make available the methods that will do the virtual server
work i need.

I have tryed to initialize COM from everywhere in the web service and i
always get the same message that states that you have to initialize COm
before doign anything or marshaling ect...

I'm starting to think that this cant be done but i'm new to all this so that
could explain alot.

Thanks for any help
 
D

Dan Rogers

The likely culprit is permissions. Administering just about any server
product assumes you have administrator rights. ASP.net web services are
seriously sand-boxed and prevented from doing anything that requires
permisions outside of the local directory for the service (and even then,
file access should be considered a no-no).

Make sure you don't have any other recourse for remote administration. If
you want to make your service call a priveleged component that then calls
the admin service, you can create a com+ component, gate the methods to the
aspnet account, and then have the COM+ component run as a priveleged
account. Elevating permissions on your IIS asp.net thread is not a good
way to go.
--------------------
 
P

POnfri

Dan Rogers said:
The likely culprit is permissions. Administering just about any server
product assumes you have administrator rights. ASP.net web services are
seriously sand-boxed and prevented from doing anything that requires
permisions outside of the local directory for the service (and even then,
file access should be considered a no-no).

Make sure you don't have any other recourse for remote administration. If
you want to make your service call a priveleged component that then calls
the admin service, you can create a com+ component, gate the methods to the
aspnet account, and then have the COM+ component run as a priveleged
account. Elevating permissions on your IIS asp.net thread is not a good
way to go.
Dan,

Thanks a bunch for your response but here is wer ei stand with this now.
I finally got fustrated and i decided to make the API calls without
initalizing COM. To my disbelif it worked just fine. Now what i'm trying to
figure out is if ASP.NET or web services make the CoInitializeEX call
automaticly or at some point whihc would make sense since its in IIS.

Thought i post this incase interested or if you can explain why this worked
:)

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,824
Latest member
Nater888

Latest Threads

Top