0

This is my situation, I need to get a data from a smart card through a client application, after that I need to pass that data to my web application written in VB.NET(Asp.NET). I've read that its possible to do it with WCF Service but couldn't really figure it how. I've google about it but all the tutorial only tell process of web application and web service. But in my case, it is client application to web services to web application.

Any help/suggestion is appreciated. Thanks in advance.

  • So send a POST request of some sorts from your client application to your web application? – CodeCaster Nov 24 '17 at 14:05
  • See following posting. There are a lot more c# answers which can be converted to vb if necessary. https://social.msdn.microsoft.com/Forums/en-US/26ba0152-fae8-454e-87cb-55841a35bbc9/need-a-vb-example-of-how-to-sign-a-form-with-a-smart-card?forum=vbgeneral – jdweng Nov 24 '17 at 14:13
  • @CodeCaster sorry, never done it and I'm abit confused as to how to go about it. – user5397881 Nov 24 '17 at 16:04
  • @jdweng thanks, i'll check it out.. – user5397881 Nov 24 '17 at 16:05

1 Answers1

0

For your client application (for example, a winform), take a look at this:

Smart card reader development with .Net technologies

You can after that create a WCF or REST api that will receive your request after reading whatever you need from your smart card (from your client application):

https://learn.microsoft.com/en-us/aspnet/web-api/overview/older-versions/build-restful-apis-with-aspnet-web-api

Finally, you have to send your data from your client application to your webapi:

How do I make calls to a REST api using c#?

Note: If you want to create a wcf instead of the web api, take a look at this:

https://www.codeproject.com/Articles/42643/Creating-and-Consuming-Your-First-WCF-Service

Let me know if you need more info. Also, provide more information about what you already have and what you don't (do you have the client application?)

  • I've already built the smart card reader development. I'm only stuck at the part to send the data from the smart card reader to the web application. I understand about the part to send the data to the web service. But, what I don't understand is that once the web service/wcf get the data, how do I send it to the web application? – user5397881 Nov 24 '17 at 16:08
  • That will depend on your solution. You can store the data on a database and read from that later, or you could just send an http request from your client app and accept the value on a query string parameter (for example, MyPage.aspx?parameter=value). It is hard to understand the whole solution and the better approach without knowing exactly your requirements and what you have already done. – Alejandro Techera Nov 25 '17 at 17:42
  • Firstly, thanks for the help/advice/suggestion sir. I really appreciated it, and thanks for the http request suggestion, I would take that into consideration. But, can I do it like this, where I open up my Web Application first, then, I open up the client application to read from the smartcard, after the client has gotten the value from the smartcard, it passed the value to the opened web application? Is it possible and if it is, is it better than the http request method? Thanks and sorry for all the trouble. – user5397881 Nov 27 '17 at 04:40
  • Well, you could use SignalR to "open a socket" and listen to it. Then write what you read on the smartcard. See the following article, it may help you https://www.codeguru.com/columns/experts/how-to-push-data-from-server-to-client-using-signalr.htm – Alejandro Techera Nov 27 '17 at 11:56