[
https://issues.apache.org/jira/browse/OFBIZ-4274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13031517#comment-13031517
]
Adrian Crum edited comment on OFBIZ-4274 at 9/19/11 10:13 AM:
--------------------------------------------------------------
OFBiz services are based on the concept of Map In, Map Out. So the HTTP request
and response bodies are nothing more than the Maps going into and out of the
services. This simple approach leverages all of the existing OFBiz service
documentation and web tools - there is no new API to learn.
Representation handlers will convert the in/out Maps to various representations
- HTML, XML, JSON, etc. Applications can implement custom representation
handlers.
XStream will be used for the XML representation:
http://xstream.codehaus.org/converters.html
was (Author: [email protected]):
By default, request payloads (HTTP entity) are basically the target
service's parameters wrapped in the resource name. In an XML payload the
service parameters are child elements of the resource element (whose tag name
is the resource name). This approach leverages the existing service definitions
to define a REST resource API.
By default, response payloads are the service results. The service result Map
is converted to the requested media type.
In cases where the request payload is controlled by an external application, a
custom media handler can be provided for conversion. See the attached patch for
an example.
The servlet will support media handlers that convert payloads to/from media
types (XML, JSON). See the attached patch for an example.
> Implement a REST Servlet
> ------------------------
>
> Key: OFBIZ-4274
> URL: https://issues.apache.org/jira/browse/OFBIZ-4274
> Project: OFBiz
> Issue Type: New Feature
> Components: framework
> Reporter: Adrian Crum
> Priority: Minor
> 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.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira