[
https://issues.apache.org/jira/browse/OFBIZ-4274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16477992#comment-16477992 ]
Mathieu Lirzin commented on OFBIZ-4274:
---------------------------------------
I have been [studying for a month|
https://markmail.org/message/ulsnwg6vs53f5o5w] the various options to expose OFBiz services and entities as an HTTP REST API.
The main parts of this endeavor consists in:
* Defining a Domain Specific Language to associate routes to services.
* Choosing a platform to handle the HTTP requests
Existing Web frameworks (Juneau, CXF, Vert.x, ...) provide solutions for solving both aspects. However their DSL tend to not fit the XML configuration idiom of OFBiz, and are generally tied to a particular Language (Java, Groovy, ...). Moreover I am a bit reluctant to make OFBiz dependent on a particular framework which is not backed by a solid standard (like [JAX-RS|
https://en.wikipedia.org/wiki/Java_API_for_RESTful_Web_Services]).
Besides those web frameworks, I have discovered [Apache Camel|
https://camel.apache.org/] which is a mature integration framework based on the patterns described in the excellent [Enterprise Integration Patterns|
https://en.wikipedia.org/wiki/Enterprise_Integration_Patterns] book. Camel provides a [REST DSL|
https://camel.apache.org/rest-dsl] which seems to fit OFBiz idioms nicely since it can be written both in XML and Java, and it handles generic endpoints.
While in the long run I think It might be interesting to [integrate Camel within OFBiz|
https://github.com/bibryam/ofbiz-camel] more deeply since it seems that integration of OFBiz with external solutions seems to be the norm (in my short experience), having to deal with its genericity would be a bit overwhelming for me. So what I am proposing here is to take inspiration from this REST DSL and adapt it to OFBiz. In term of infrastructure the HTTP routes will be served by a basic Java Servlet. Of course like every initial plan it will have to be reevaluated while implementing it.
Suggestions and comments welcome.
> Implement a REST Servlet
> ------------------------
>
> Key: OFBIZ-4274
> URL:
https://issues.apache.org/jira/browse/OFBIZ-4274> Project: OFBiz
> Issue Type: New Feature
> Components: framework
> Affects Versions: Trunk
> Reporter: Adrian Crum
> Priority: Minor
> Labels: REST
> Attachments: RestExampleSchema.xsd, RestXmlRepresentation.xml, rest-conf.xml
>
>
> Implement a REST servlet that will map REST requests to OFBiz services. Details are in the comments.
> [here is the discussion which took place on the dev ML|
http://markmail.org/message/ai6q2fbksowaayn4]
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)