Hi Yasas,
The points you have mentioned are correct, but there are small changes I
would like to point out. Below are the steps you'll need to follow to
achieve your goal.
1 - There is a patch release for the "axis2-json" so you'll need to check
out the source from [1] instead of the svn location you have mentioned.
(checkout the whole "patch0007" instead of json module, so that it'll be
easy for you to build the source.)
2 - Add the classes you need to the source.
You'll need to extend AbstractJSONMessageFormatter in your custom
formatter class
You'll need to extend AbstractJSONOMBuilder in you custom builder
class
3 - Build the whole patch0007. Then go to
"patch0007/dependencies/orbit/axis2-json/target" folder where you can find
the osgi bundle created from "axis2-json" module.
4 - Create "patch0008" folder inside
"DSS_HOME/repository/components/patches" folder and copy the osgi bundle
you found in step 3 to that folder.
5 - Add "messageFormatter" and "messageBuilder" elements to the
"DSS_HOME/repository/conf/axis2/axis2.xml" as you have pointed out in your
step 3.
6 - Restart the server and invoke your service adding "Accept" request
header to the request with new content type you mentioned in "axis2.xml",
example would be "Accept:application/json/newformat".(You can find sample
of how to do it in [2])
[1] -
https://svn.wso2.org/repos/wso2/carbon/kernel/branches/4.2.0/patches/patch0007/dependencies/axis2/modules/json/
[2] -
http://janakaranabahu.blogspot.com/2013/06/return-json-response-from-wso2-dss.html
Thanks,
On Sun, Jul 13, 2014 at 1:45 PM, Yasas Karunarathna <[email protected]>
wrote:
> Hi there,
>
> I want to do a small change to the json response returned from DSS 3.2.1.
> I'm using JSONMessageFormatter & JSONOMBuilder in org.apache.axis2.json
> package.(not gson implementations)
> My requirements are as follows
>
> 1) Implement new JSONMessageFormatter, JSONOMBuilder etc.
> And additional method accepting the Mapped json response and format it
> accordingly, call it at the end of mapped json conversion.
> 2) Build axis2-json-1.6.1-wso2v10.jar adding new classes.
> I think this is the source used in DSS 3.2.1 :
> https://svn.wso2.org/repos/wso2/carbon/kernel/branches/4.2.0/dependencies/axis2/1.6.1-wso2v10/modules/json
>
> 3) State new Formatter and Builder in axis2.xml & call it with new header
> <messageFormatter contentType="application/json/newformat"
>
> class="org.apache.axis2.json.newJSONMessageFormatter"/>
>
> <messageBuilder contentType="application/json/newformat"
> class="org.apache.axis2.json.newJSONOMBuilder"/>
> Can anybody advice me on achieving the above requirements?
>
> --
>
> Thanks
>
>
>
> *Yasas Karunarathna*
> yasasblog.wordpress.com
>
> _______________________________________________
> Dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>
--
Rajith Vitharana
Software Engineer,
WSO2 Inc. : wso2.com
Mobile : +94715883223
Blog : http://lankavitharana.blogspot.com/
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev