Hi Vivek,

You can also get json response with controller like this
<request-map uri="test-request">
       <security https="false" auth="false"/>
       <event type="service" invoke="serviceName"/>
       <response name="success" type="request" value="json"/>
</request-map>

internally CommonEvents.jsonResponseFromRequestAttributes converts response
to json response so it has to be redirected to json uri.

<request-map uri="json">
        <security direct-request="false"/>
        <event type="java" path="org.ofbiz.common.CommonEvents"
invoke="jsonResponseFromRequestAttributes"/>
        <response name="success" type="none"/>
    </request-map>

Thanks and Regards,

*Aditya Sharma* | Enterprise Software Engineer
HotWax Commerce <http://www.hotwax.co/> by HotWax Systems
<http://www.hotwaxsystems.com/>
Plot no. 80, Scheme no. 78 Part 2, Near Brilliant Convention Center, Indore,
M.P, India - 452010
Cell phone: +91 7415786147

<https://www.linkedin.com/in/aditya-sharma-78291810a/>
<https://www.facebook.com/divinecreatureaaditya>
<https://www.instagram.com/iamaadi7/>

HotWax Systems recently received 8 mentions in *The Gartner Digital
Commerce Vendor Guide, 2016 *by Gartner, Inc., the world's leading IT
research and advisory company. Learn more about our research here
<https://www.gartner.com/technology/media-products/newsletters/HotWax/1-2UVLP6M/index.html>
.

<http://www.hotwax.co/>

On Mon, Sep 18, 2017 at 6:42 PM, Chandan Khandelwal <
[email protected]> wrote:

> Hi Vivek,
>
> Here is the reference code block of request to get JSON output. You could
> simply write service to prepare and return information as needed. HTH!
>
>      <request-map uri="test-request">
>         <security https="false" auth="false"/>
>         <event type="service" invoke="serviceName"/>
>         <response name="success" type="view" value="JSONOutput"/>
>     </request-map>
>
> --
> Thanks & Regards,
> Chandan Khandelwal
> HotWax Systems
> Direct: +91-9893481076
> http://www.hotwaxsystems.com/
>
> On Sat, Sep 16, 2017 at 3:52 PM, Jacques Le Roux <
> [email protected]> wrote:
>
> > This http://markmail.org/message/rhnrge4xh7ctcd4e (did not try)
> >
> > You can also use a json response in a controller, look for the same in
> > existing controllers
> >
> > Jacques
> >
> >
> >
> > Le 16/09/2017 à 11:51, Vivek a écrit :
> >
> >>
> >> hi ,
> >>
> >> https://cwiki.apache.org/confluence/display/OFBIZ/OFBiz+Tuto
> >> rial+-+A+Beginners+Development+Guide#OFBizTutorial-ABeginner
> >> sDevelopmentGuide-CreateYourFirstApplication(HelloWorld...)
> >>
> >>
> >> i follow this link to make service and events. in this i have no
> problem.
> >>
> >> now i want to ask -
> >>
> >> how can i make rest api to get ofbiz entity data ( product , order ,
> >> party) in json format for third party.
> >>
> >> Thanks
> >> Vivek tiwari
> >>
> >>
> >
>
>
> --
> Thanks & Regards,
> Chandan Khandelwal
> HotWax Systems
> Direct: +91-9893481076
> http://www.hotwaxsystems.com/
>

Reply via email to