Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This tutorial documents the steps to expose an ofbiz service using REST. The ofbiz ping service is exposed.  The ping service returns a copy on the input message to the response.  If the input message is null, ping returns PONG.


This is related: REST Service Implementation

The following steps show Apache wink was chosen as the REST implementation purely on the basis that it is an apache project. on base of Apache Wink.

Info
titleApache Wink is retired

As of April 2017, Apache Wink is retired. For new REST implementations, it is not recommended to use it.

This tutorial does not work with OFBIz Release 16.11 and above.

This page will be either updated with an alternative or deprecated in the future.

Assumptions

This tutorial assumes you have followed the ofbiz developer tutorial: http://cwiki.apache.org/confluence/x/cQFk

...

Code Block
ant create-component

Component name: restcomponent
Component resource name: RestComponent
Webapp name: restcomponent
Base permission: RESTCOMPONENT

Step 2 - Grab

...

Apache Wink*

Download apache wink . I used httpfrom here: https://wwwwink.apache.org/dyn/closer.cgi/incubator/wink/1.0-incubating/apache-wink-1.0-incubating.zipdownloads.html

Unzip and copy lib/* and dist/* to your ofbiz component restcomponent/lib

\* read this https://dzone.com/articles/apache-cxf-vs-apache-axis-vs for a comparison between 3 2 Apache solutions regarding REST REST and Spring WS

Step 3 - Create java files and update web.xml

The steps followed were taken from the wink user (i.e. developer) guide):  http://incubator.apache.org/wink/1.0/Apache_Wink_User_Guide.pdf:  apache-wink-developer-guide.html

In the folder restcomponent/src/restcomponent, create:

...