1

I work currently on project that will be developed by two suppliers.

  1. First supplier my company is responsible for ASP.NET MVC 3 application that will be hosted on Azure. This application will analyze data gathered by RFID readers and ZigBee readers devices. I have to also design WCF service that will be responsible for communication. I would like to emphasize that we are not experts about hardware devices and unmanaged C.

  2. Second supplier, other company will deliver devices, and that will be device using ZigBee low energy wireless propagation network. Each device can work in 3 states, gather data, propage, or become manager for all. The "manager" will communicate with WCF service to transfer data to Azure SQL database.

Device specs:

  1. Micro-controller Stellaris (LM3S9B90)
  2. GPRS modem SIM900 SimCon, enables TCP/IP and HTTP communication
  3. Unmanaged C

And my questions are:

  1. Are you familiar with communicating with WCF from unmanaged C?
  2. Is there any DLL for C language to create proxy form WCF SOAP WSDL ?
  3. Is there any DLL for easy use REST WCF service from unmanaged C?
  4. Can I secure this WCF with x509 certificate and communicate on https, is it possible that under unmanaged C communication will be stable and secure?

I am under the pressure of time. So I will be grateful if you can point me any clues.

Thanks in advance.

Daniel

2 Answers2

1

When you say "unmanaged C" I am assuming that your development environment is Visual Studio using C/C++. Is that correct. There is a discussion on using a C++ client to communicate with WCF here. I have not personally used C for a client to a WCF service but I have used JavaScript and Java clients to call WCF when WCF was configured for REST. I would recommend REST for ease of implementation across platforms. There should be some way to make a simple HTTP request from C, which is all you need to be able to do for communicating with a REST API. The downside of REST will be security. I am not sure how secure this needs to be but you can provide some security by using certificates and requiring credentials in your API.

Community
  • 1
  • 1
Kevin Junghans
  • 17,475
  • 4
  • 45
  • 62
  • _When you say "unmanaged C" I am assuming that your development environment is Visual Studio using C/C++. Is that correct._ Unfortunately I don't think so. They will probably use something rare and old that Visual Studio for the C code (and for sure it will not be C++). I also remind that the program on low level microprocessor layer. But I will ask them do they use any IDE for the unmanaged C, and this information. – Daniel Skowroński Jan 25 '12 at 14:28
  • Not sure if it is an options here, but I have taken unmanaged C code and put a C++ managed code wrapper around it to so that the C library could be used by managed code. This worked quite well. If making HTTP requests is not possible from the C code another approach is to find out what methods of inter-process communications are available (ex: Sockets). You may have to develop a middleware that translates messages using a different communications method to a WCF call. – Kevin Junghans Jan 25 '12 at 15:31
  • I received information that The Hardware Supplier will use Code Composer Studio (TI) Stellaris version to compile unmanaged C. Is not possible to add any DLL as device will have neither any operating system nor CLR. What is more it is not possible to add any managed wrapper to device, as a result that C code will be controlled by "use of interrupts" on microprocessor. At this stage I have only two solutions, connect them using as you said Sockets or they will send me with timer data. We would like to use REST WCF, still I am not sure how They would send data to my REST Service from C. – Daniel Skowroński Jan 25 '12 at 18:13
  • @Daniel Skowroński If you can get TCP/IP operational, there's quite a few SOAP libraries for C, you will have to investigate which of those is feasible to port to your device. Such libraries are generally _huge_. You might get away with just an HTTP library if you do REST only. The work involved is non-trivial, far from dropping in a pre-compiled library and add some glue code. – nos Jan 25 '12 at 19:49
0

As Kevin points, it would be exremely easier if you make your services REST based. Than you could refer this question. Quire relevant for the topic. You could secure your REST with X.509 certificate.

Please note that I have not personally tested the provided libraries, as I am not that much experienced with C/C++. But since the POCO libraries have HTTPRequest and HTTPResponse classes. They, along with X509Certificate should be enough for you. Of course, security may be a bit tricky, but these are good starting point.

Community
  • 1
  • 1
astaykov
  • 30,768
  • 3
  • 70
  • 86