Delphi XE2 DataSnap Server - Log client connection user/properties

I'm building an XE2 DataSnap server which will serve connections from REST clients.  My DSServerClass LifeCycle property is set to 'Invocation'. What I want to do is to log the details of all client connections to the server, including the following details : username, IP address, protocol, application name.  I can currently get these details using the following events :

DSAuthenticationManager - UserAuthenticate() : username, protocol  (using the standard parameters passed in)
DSServer - Connect() : protocol, IP address, application name  (using DSConnectEventObject.ChannelInfo.ClientInfo)

What I want to do is just log once for all details, but it seems I can't get all the details I need in one event.  I tried using a shared private variable in the class but as expected this gave inconsistent results - the wrong IP address against the wrong username.  Is there another way to achieve what I want?

Thanks,

Jonathan
0
Jonathan
6/13/2012 9:03:43 AM
embarcadero.datasnap 643 articles. 0 followers. Follow

1 Replies
2023 Views

Similar Articles

[PageSpeed] 26

Managed to solve this by accessing the username in the DSServer Connect event as follows :

Session := TDSSessionManager.GetThreadSession;
User := Session.UserName;


Jonathan
0
Jonathan
6/14/2012 7:40:12 AM
Reply:

Similar Artilces:

XE Datasnap Client expection with a XE2 DataSnap Server.
I have developed a simple DataSnap Server on XE2 and the client that connects to this server is under XE. Everything works just fine except when freeing the ClientProxy Module on the client side I get the following exception " TDXError with message Invalid Ordinal 3." followed by a AV. Any hints how to avoid this exception or the Server must be on XE also? Thanks in Advance, Omar Zelaya I have now the DataSanp Server on XE and the client no longer throws the exception. So the question now is, it is possible to use a XE DataSnap Client with a XE2 DataSnap Se...

Connect Old Datasnap Clients with new datasnap Server ? [Edit]
Is it possible to connect a XE5 datasnap server with Borland C++ 6 Datasnap clients ? I want to know this before starting ... Edited by: Bart vd Voort vd Kleij on Jan 9, 2014 11:49 PM Edited by: Bart vd Voort vd Kleij on Jan 9, 2014 11:51 PM ...

Indy 10
This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --JivePart=_39eb5.zeB8CwDOH5aMJzMl Content-Type: text/plain; charset="Utf-8" The udp client component would be used in the datasnap server. The udp server component would be used in the datasnap client. --JivePart=_39eb5.zeB8CwDOH5aMJzMl Content-Type: application/x-zip-compressed; name="UDPDSClinetstub.zip" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="UDPDSClinetstub.zip" UEs...

Upgrading Delphi 7 Datasnap to XE: client fails to connect to server [Edit]
Hi, I'm currently working on upgrading a codebase from Delphi 7 to XE, and am currently just trying to get an older school Datasnap application working under XE. For reference: I'm developing/testing on Windows 7 64bit and currently using Delphi XE. The client application connects to the app server via a socket connection currently, and thus uses Borland Socket server, which includes using a registered "Interceptor" which does data compression/decompression. Now the problem: Currently I'm running into a problem trying to get the client to actually talk to t...

Datasnap Rest client and no datasnap server
Hi, it's possible to use a delphi datasnap rest client to consume a rest web services written in other lenguages (like java or php) or i have to use an idhttp (or other) component? Thanks. Bye Pasquale Di Giovanni wrote: > > it's possible to use a delphi datasnap rest client to consume a rest > web services written in other lenguages (like java or php) or i have > to use an idhttp (or other) component? You could in theory, but it may be more trouble than its worth. You'd probably have to have control of the REST server so you can implement all the...

DataSnap server
I have a Delphi XE2 DataSnap server (Windows service) connected to a backend MS SQL Server 2008 (same server box) serving REST client requests. Everything has been working great for some time until recently I had an issue where for some reason the DataSnap service lost connection to the SQL Server. The service failed to re-establish a connection and I had to restart the DataSnap service to continue. This got me thinking because currently the service only uses 1 SQL connection (TADOConnection) shared fo r all the client requests. I did this because I didn't want the overhead of instant...

Android Client And DataSnap Server XE2
Hi, I'm doing some tests on Android to call a DataSnap server method that returns a simple class. Delphi Side: TPrueba = class private FUnString : string; public published property UnString : string read FUnString write FUnString; end; Java Side: private class TPrueba { public String UnString; } With the following Datasnap server method: function RetornaEstructura(Value : string) : TPrueba; When I generate the java.android proxy the method returns a TJSONObject. 1. Is the Java class definition ok to match the Delphi one...

Delphi 2009 Datasnap server and client
Hello, I am trying develop Datasnap server and client. I have a type TStringArray = array of string;. I used this type in one of server method. When I am trying to Generate Datasnap Client classes it says 'Remote error:Unknow data type: TStringArray'. How can I register this data type? -- Best Regards Md. Shariful Alam Khan Hello, Isn't there anyone to answer my question? Also I am getting same error if I use TStrings or TWideStringArray. Best Regards Md. Shariful Alam Khan "Md. Shariful Alam Khan" <murad_mouri@yahoo.com> wrote in messag...

Delphi XE2 DataSnap SSL connection
Hi, I need to create Delphi XE2 DataSnap desktop application working over internet. So I want to use SSL encryption for communication between server and clients with public and private key. Server must accept connections only with proper SSL key ( datasnap server must check this ). And I have questions: 1. Which is better protocol for this - HTTPS or TCP/IP with encryption filters? 2. Can I see somewhere example how to do this with SSL public and private key, because I can not find such example? Thanks in advance, Ivan ...

DataSnap XE2 , is this bug in datasnap ?
Hello I create small datasnap server , the lifecycle=session , the problem is : Create client and put tow sqlconnection in form or datamodule , and connect to that server , when made call , the methods in servermethods (may or may not) one of the servermethod class is destroy , many ways to call methods in both connections but the class is destryed in server. I trace and debug every thing possible but nothing wrong . I test these on xp ( sometimes problem is on ) I test on win7 same as above I test on Server2003 , the same I test on server 2008 , the same I test it as Delphi im...

Blob Field through DataSnap Client/Server Delphi 2009
I can't pass Blob Field through DataSnap Client/Server Delphi 2009, when I try to Open the TSqlServerMethod this says Remote Error: unexpected metadata type, but, that only when the Table or Query have Blob fields. > {quote:title=ALEXANDER DAVID CRUZ MARQUEZ wrote:}{quote} > I can't pass Blob Field through DataSnap Client/Server Delphi 2009, when I try to Open the TSqlServerMethod this says Remote Error: unexpected metadata type, but, that only when the Table or Query have Blob fields. Hi. I have exactly the same problem. Seems it's not a just an error but it's a D...

DataSnap XE2 Standalone Server
Hi, I have a standalone (Windows service EXE) DataSnap server which is accepting HTTPS connections using the standard components (TDSHTTPService, TDSCertFiles) in Delphi XE2 and the 2 OpenSSL DLLs. Generally this is working fine, however we have an intermittent problem where the client request appears to be rejected by the server (no problems occur with HTTP). If we retry the request then it works. With Win32 clients we get 'Connection Closed Gracefully', and with iOS clients it returns HTTP code 200 (succ ess) but with no response headers and an empty response body. We're ...

IP address of clients, connected to DataSnap server [Edit]
Hello. Please help with answers: Is it possible to obtain list of clients currently connected to the DataSnap server, including IP adresses? What class i need to use for it? Edited by: Sergey Ryasnyanskiy on Jun 19, 2011 9:53 PM There is no default way to accomplish this task without some programming on your part. If you find that you can obtain the correct IP from the OnConnect event (in XE you may find the IP returned is the Server's IP) then you can store that IP in the session (Session := TDSSessionManager.GetThreadSession;) using the get/put data functions. You can later g...

How can I update a DataSnap server while clients are still connected?
We use stateful DataSnap servers for some business logic tasks and also to provide clientdataset data. If we have to update the server to modify a business rule, we copy the new version into a new empty folder and register it (depending on the Delphi version, just by launching or by running the TRegSvr utility). We can do this even while the old server instance is running. However, after registering the new version, all new client connections will still use the currently running (old) server instance. All clients have to disconnect first, then the new server will be used for ...

DataSnap XE2 : REST vs dbExpress client connection
Hi, I have a DataSnap server method which returns a TStream object to serve file downloads. When calling the method in a client using a TDSRESTConnection, the method call appears to wait until the file has been transferred before allowing the stream to be read. However when calling the same DataSnap service method using a TSQLConnection, the method call completes instantly which allows me to read the stream and display a download progress bar. I'm using a REST connection because the target client applicati on I'm writing is for Android and the Java proxy I have doesn't have ...

Web resources about - Delphi XE2 DataSnap Server - Log client connection user/properties - embarcadero.datasnap

Connection - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

iMedia Connection: Interactive Marketing News, Features, Podcasts and Video - iMediaConnection.com
High-quality data, if not used properly, can still lead marketers to make bad decisions. Consider these common ways that numbers are used to ...

HTTP persistent connection - Wikipedia, the free encyclopedia
... tacked on to an existing protocol. If the browser supports keep-alive, it adds an additional header to the request: Following this, the connection ...

CareerSonar Turns Facebook Friends Into Job Connections
Looking for a job ? Among your Facebook friends lies the potential for employment. CareerSonar , a new service, brings together a person’s connections ...

Sydney's beauty relies on its visual and physical connection to nature
Landowners, custodians and developers must collaborate to create a healthy environment, happy residents and a more productive city.

Adam Savage from 'MythBusters' has an incredible connection to the 'Star Wars' franchise
Adam Savage, co-host of the popular " MythBusters " television show, soured on the plot of "Interstellar." But when it comes to the newest films ...

Heavyset woman with facial hair arrested in connection to downto - CBS News 8 - San Diego, CA News Station ...
Police were on the lookout Thursday for a heavyset woman with facial hair who stabbed a man in the East Village.

10th person arrested in connection with Paris attacks
CNN 10th person arrested in connection with Paris attacks CNN (CNN) Belgian police have arrested a 10th person in connection with last month's ...

Should auld connections be forgot...
This environmental testing company has strict data-retention requirements and they go beyond the data, reports a pilot fish on the scene. "Per ...

Test Claims To Show T-Mobile’s YouTube “Optimization” Is Just Connection Throttling
... on the same network, and at the same time of day. They tested video streaming against three other kinds of downloads and measured the connection ...

Resources last updated: 1/7/2016 10:21:53 AM