1

we are planning to develop ASP.Net webservices for methods provided in Zkteco SDK.

One of the web-service is to Connect to the device. After invoking "Connect_Net(string IPAdd, int Port)" method, the connection is successful, also in the method, we register few events such as below:-

public bool Connect_Net(string IPAdd, int Port)
        {
            if (objCZKEM.Connect_Net(IPAdd, Port))
            {
                //65535, 32767
                if (objCZKEM.RegEvent(1, 32767))
                {
                    // [ Register your events here ]
                    // [ Go through the _IZKEMEvents_Event class for a complete list of events
                    objCZKEM.OnConnected += ObjCZKEM_OnConnected;
                    objCZKEM.OnDisConnected += objCZKEM_OnDisConnected;
                    //objCZKEM.OnEnrollFinger += ObjCZKEM_OnEnrollFinger;
                    objCZKEM.OnEnrollFingerEx += new _IZKEMEvents_OnEnrollFingerExEventHandler(ObjCZKEM_OnEnrollFingerEx);
                    objCZKEM.OnNewUser += ObjCZKEM_OnNewUser;
                    objCZKEM.OnFinger += ObjCZKEM_OnFinger;
                    //this.objCZKEM.OnVerify += new zkemkeeper._IZKEMEvents_OnVerifyEventHandler(ObjCZKEM_OnVerify);
                    objCZKEM.OnAttTransactionEx += new _IZKEMEvents_OnAttTransactionExEventHandler(zkemClient_OnAttTransactionEx);
                }
                return true;
            }
            return false;
        }

But after connection, those events (OnEnrollFinger, On Clock-In etc..) are not getting invoked in ASP.NET Webservices.

Similar listeners work fine in a windows form application.

Can you please advice on how to resolve this?, should the above events be registered in a background thread?, if yes then how to do so?.

Thanks

1 Answers1

1

In my case, I did it in windows forms application and then pass data to the web API

rjs123431
  • 688
  • 4
  • 14
  • Thank you, but how do i develop a seamless solution, where get-data and listeners work properly? – user3875039 Mar 30 '19 at 10:28
  • I would suggest you separate the listeners - using windows form/service, to pass real-time data to web api/service. And use web service to expose data to other applications – rjs123431 Apr 01 '19 at 07:35
  • @user3875039 its happening the same, did you resolve it? – Gonzalo Arzeno Feb 26 '20 at 17:55
  • @GonzaloArzeno I only used the `OnAttTransactionEx` event and its working fine in my case using windows application running in background. – rjs123431 Mar 02 '20 at 13:01
  • If you are out of luck getting the event listeners working, you may use the `ReadTimeGLogData` to read logs between two dates – rjs123431 Mar 02 '20 at 13:09
  • Yeah, the thing is that I dont want a background application, and also, I need the real time event because its for enrolling people – Gonzalo Arzeno Mar 02 '20 at 17:31