IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.



#Automation


#Applicationintegration
#webMethods
#Integration
 View Only
  • 1.  Pagination for DB data

    Posted 09/30/19 11:55 AM

    Hi

    My requirement is to fetch the XXX records (Sometimes 100+) from DB, convert into json and send response thru setresponse as this is rest call. My question is how to achieve pagination for sending large amount of data in response? My Source is third party vendor and they want the response to be paginated in webMethods if the response data contains large amount of data.

    Can someone please help me to how to achieve this? Do I need to write java service or Can I handle it in DB/setresponse calls?


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 2.  RE: Pagination for DB data

    Posted 10/01/19 10:23 AM

    You need to build your json response something similar to this? can you check with the client?

    HTTP/1.1 200 OK
    Content-Type: application/vnd.api+json
    
    {
    "meta": {
    "totalPages": 13
    },
    "data": [
    {
    "type": "articles",
    "id": "3",
    "attributes": {
    "title": "JSON:API paints my bikeshed!",
    "body": "The shortest article. Ever.",
    "created": "2015-05-22T14:56:29.000Z",
    "updated": "2015-05-22T14:56:28.000Z"
    }
    }
    ],
    "links": {
    "self": "http://example.com/articles?page[number]=3&page[size]=1",
    "first": "http://example.com/articles?page[number]=1&page[size]=1",
    "prev": "http://example.com/articles?page[number]=2&page[size]=1",
    "next": "http://example.com/articles?page[number]=4&page[size]=1",
    "last": "http://example.com/articles?page[number]=13&page[size]=1"
    }
    }

    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 3.  RE: Pagination for DB data

    Posted 10/02/19 04:09 AM

    Thank you…

    Can you please explain a bit more , I thought of using documenttojsonstring and sending data thru setresponse. So where to use the above code If I want to paginate first 50 transaction in one page


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services