Click here to Skip to main content
15,886,017 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I've been asked to write a web service that will serve many web based clients simultaneously.

I have previously created web services that service only one client.

My web service will connect to a com-object and retrieve data from another application from that com-object.

With a web service being stateless, how can I do this?

There will be a lot of GetFirst / GetNext calls to retrieve data, but I can't figure out how to do this without declaring my variables as shared.

For instance, if I declare the com-object as public in my web service and create it during a InitializeClass call, the com-objects value is NOTHING when I call GetFirst immediately after initializing.


Any help would be greatly appreciated...

Thanks
Posted

1 solution

I'm not sure where your problem is. Because a service is stateless as you already note, then dealing with one client or multiple clients makes no difference. COM objects should be instantiated as you need them on an instance by instance basis. Then you'll have no issues.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900