Llocer/llocer_ocpi

Usage of OCPI library

susanthomasv99 opened this issue · 6 comments

Hi, I'm trying to test the location modules example using this library. But I'm having trouble with understanding the main server code which I have to run. What do I have to do to test this library?

Hi,

Thanks for your interest in these librarians.

You have full-functionality examples of OCPI nodes at librarian llocer_ev_examples. In particular, there are examples of location module as sender and location module as receiver.

The main page of this librarian contains a description of the examples.

Do not hesitate to ask any doubt.

Kind regards.

Thank you for replying. Can I run these sender and receiver modules independently? It shows an error that main method is missing. Also, Any API implementation required to test this?

Yes, sender and receiver are independent modules.

Can I ask which servlet container are you using? These examples have been tested using Tomcat.

You can post the text of the error you refer.

Hi,

OCPI protocol is based on HTTP, being OCPI nodes an specialization of HTTP servers. As you know, the usual way to implement in Java a HTTP server is implementing a servlet and run it in a servlet container as Tomcat.

The servlet implementation is totally included in this librarian (here). Thus, usual steps will be:

  • create in your preferred IDE the maven projects for the librarians and compile them.
  • create the war file that includes all the necessary jar files.
  • configure your servlet container to run previous war
  • configure your network to accept HTTP request to the address of the servlet container.