0
votes

I am developing a 3 tier database application. 1.) MS SQL DB 2.) Middle tier SOAP Server (with Delphi 7) connected to the DB 3.) Clients (first win32 gui (with Delphi 7) - later other platfomrs) connected to the SOAP server

I chose a SOAP Server to be open to various clients at a later stage (also some of the win32 gui clients will be stationed abroad - so the clients need to be thin) (this as suggested by Dr. Bob).

I am new to SOAP and have been looking at different examples and papers about authentication. But cant quite get my head around it.

I have made a SOAP server and client with Delphi's SOAP Server Application Wizard and added a SOAP SERVER Data Module, added a database connection and some datasets and providers. Connected the client with dbgrid etc and that part works fine.

But I want the client first to login and then be able to access data and I want the server to log each connection and also when the client logs off or is disconnected, so I am guessing I need the sessionID and a timeout. I also want the server to be able to tell the clients who else is "connected" (or whos session is still active) at any given time. I have gathered that I need to make a authentication header, but cant figure out where or who I can get a sessionID. I presume that each time a client connectes to the server the server generates a sessionID? How do I get this?

Any help or suggestions/pointer would be appreciated,

thanks Justin

3

3 Answers

1
votes

Soap servers do not provide sessions by default. Your server has to implement Session life cycle managment (Login / Logout) etc.

A basic solution is documented here: Managing sessions with Delphi 6 Web services

Note however that this solution is far from perfect (see comments), for example it does not provide a session timeout mechanism.

0
votes

OK - figured it out - I had not:

InvRegistry.RegisterHeaderClass(TypeInfo(IThorPayServerDB), TAuthHeader);

in the initialization


But I still cant figure out how to get the session ID - or some unique way of know which client session is loged in to the server - any ideas?

0
votes

Delphi XE uses a newer version of SOAP, maybe that is the answer:

https://forums.embarcadero.com/thread.jspa?messageID=200793