Configure service rest and send out pagelist data in json format as response.
I have a requirement where client will be invoking the service rest held in pega, we take request ,fetch the results from db on a pagelist say ResultPage.pxResults and send this pagelist data out as a JSON response.
Can any one let me know in detail how to convert pagelist data into JSON format.
Also for configuring service rest do i need to create any data mapping rules or class.. Please help.
Thanks In Advance.
**Moderation Team has archived post**
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
Before introducing new Rule-Service-Rest rule in your application, you need to identify the following things
1.Define the Service package rule for Rule-Service-Rest
2.Identify whether your service package should be Stateful or Stateless in processing mode
3.Does it requires Authentication ?
4.If yes, define new Authentication Service
5.Define the pooling parameters in the Service package
Once, your service package is ready, then define Rule-Service-Rest rule
In service rest rule, identify the following things
1. Define new class structure in primage page context in Service tab.
2. Define the new page name in the service tab
3. Identify the Execution mode whether it should be Synchronously or Asynchronously.
4. In methods tab, identify which method would like to be invoked (GET,POST,PUT or DELETE)
5. Define your service activity in the methods
6. In Request and respone, identify the attribute which are needed.
7. In response option, define the Map from as JSON and mention your page structure pagelist in MapFromKey. Service rest automatically converts the pagelist into JSON object.
Keep up to date on this post and subscribe to comments
- How to convert clipboard page to JSON format to send as a response to the service?
- Is there any example for configure Connect-REST and parse Request/Response in JSON format in PRPC 6.2 SP2? There is no OOTB API such as adoptJSON or getJSON available in 6.2 SP2.
- Can we zip the Json file in response of a REST service and send it accross to the connecting application?
- Unable to send response as JSON in rest services.
- List of all DEBUG loggers to log Service REST/SOAP request and response.