You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by keith chapman <ke...@gmail.com> on 2007/02/15 12:09:32 UTC

[AXIS2] MessageFormatters for REST

Hi,

I have removed RESTSender and enabled HTTPSender to support all HTTP
methods. Now REST messages are also formatted using the messageFormatter
concept. I have added two formatters for REST ApplicationXMLFormatter (which
formats messages as application/xml) and XFormURLEncodedFormatter (which
formats messages as application/x-www-form-urlencoded). I have added these
mappings into the default axis2.xml. In order to format request using these
formatters a property in the message context should be set.

To use ApplicationXMLFormatter set the following property to messageContext
(org.apache.axis2.Constants.Configuration.MESSAGE_TYPE,
HTTPConstants.MEDIA_TYPE_APPLICATION_XML)
To use XFormURLEncodedFormatter set the following property to messageContext
(org.apache.axis2.Constants.Configuration.MESSAGE_TYPE,
HTTPConstants.MEDIA_TYPE_X_WWW_FORM)

Thanks,
Keith.

-- 
Keith Chapman
WSO2 Inc.
Oxygen for Web Services Developers.
http://wso2.org/