Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stateful Web Services?

Status
Not open for further replies.

asmith555

Programmer
Oct 7, 2002
97
US
Heres my situation. I have a classic asp application that currently uses com interop to store and manage user information before inserting into database. All database operations are done through the com object. Currently I have to install this object on every server that runns this application. Several servers run this same app. It just has to be this way(Don't ask). My goal is to remove the comm objects from the servers and use web services to do all this. As far as I know web services are stateless. What I need is a way to load all this information into custom classes and serve the info to application with web services so I don't get into the DLL hell I have to deal with now. Does anyone have any ideas. Can I Invoke an instance of a web service from my classic asp app and store it into a session variable to maintain its state. Or can I create an instance of a com object on a remote server and use webservices to expose its methods. Please help.
 
If you need to maintain state, something somewhere has to do it. A web service is just a way to make a remote procedure call using web technologies, which as you said, usually don't maintain state.

I think you're looking at storing state in the database. I'm not sure you can use the ASP Session region to hold your state for a web service.

Chip H.


____________________________________________________________________
Donate to Katrina relief:
If you want to get the best response to a question, please read FAQ222-2244 first
 
I'm not sure that a state would be necessary (though it can be done without too much difficulty - look at WebMethod and enableSession property).
Basically what you would want to do is create your hook into the COM class then create methods in your web service that encapsulate the calls to the COM object. If the data is complex (ie, not instantly serializeable) you will probably want to create some custom classes to encapsulate that data (and make them XMLSerializeable). So basically it would look something like this:
(Client) -- sends request ---> (Service) --- calls COM function --> (COM Object)
^- XML encapsulated data ---' ^------ com return value <------'

If you want to replace the COM object altogether, then I would suggest going the database route, however if you can't replace the logic embedded in the COM object (like not having the source, or something like that) then your pretty much stuck with encapsulating it like this.

-T

barcode_1.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top