2 Ответы Последний ответ: 24.10.2019 16:27, автор: 4077725

    Rest POST request works alternatively

    4077725

      I'm unable to figure out why POST request works alternatively. When POST request is executed, it reads request body and sends a response.

       

      JSON I get from POST, In my test I'm reading responseId from request message:

       

      {

          "responseId": "e6c50063-50c8-4481-89f3-3441a3f69fa9-f6406966",

          "queryResult": {

              "queryText": "shanghai",

              "action": "getCity",

              "parameters": {

                  "geo-city": "Shanghai"

              },

              "allRequiredParamsPresent": true,

              "fulfillmentMessages": [

                  {

                      "text": {

                          "text": [

                              ""

                          ]

                      }

                  }

              ],

              "intent": {

                  "name": "projects/p-bot-tifmco/agent/intents/e643cea1-4fcf-4165-a426-3f17ee66c4e2",

                  "displayName": "GetWeather",

                  "endInteraction": true

              },

              "intentDetectionConfidence": 1,

              "languageCode": "en"

          },

          "originalDetectIntentRequest": {

              "payload": {}

          },

          "session": "projects/p-bot-tifmco/agent/sessions/66723413-0b28-8458-d57d-1ddad54c125f"

      }

       

      It works first time, displays responseId:

       

      {
        "fulfillmentText": "Sending this string back to you e6c50063-50c8-4481-89f3-3441a3f69fa9-f6406966"
      }

       

      When I execute the POST second time:

       

       

      Failed to find property responseId on compound ZP_GETUSERINFO_REQ. Check document definition. (2,1011)

       

          ZP_PEPP_CHATBOT.getUserInfo.OnExecute Name:OnRequest PCPC:571 Statement:17

       

      It works third time and doesn't fourth, this loop repeats

       

      Do you guys know what I'm missing here...your help is appreciated.

        • 1. Re: Rest POST request works alternatively
          Jim Marion

          By alternatively, do you mean every other time? Are you using the Documents module? What I've found is that every other time the Documents module renders a response, it replaces the document primitives with binary data. It appears to me like it is reading from uninitialized memory. The only fix I have for this is clearing cache. Clearing cache seems to resolve the issue. Unfortunately, it isn't consistent, so it is hard to log a ticket for this.

           

          Note: this NEVER happens when using JsonBuilder and other JSON methods. It only happens with the Documents module.

          • 2. Re: Rest POST request works alternatively
            4077725

            Hello Jim, thanks for your response. I'm using tools 8.55, found out later that document based messages with POST requests over the period of time get corrupted after cache buildup. Even changing the document structure will have same issues, unfortunately this is what I ran in to. Oracle provided a solution to change PSAPPSERV config file in the integration broker (Physical Document Cache = 0), this parameter is not helping document is again getting corrupted. I hope this is fixed in later version of tools.

             

            Alternative option using peoplecode JSON methods and classes worked solid for me in past but for this project  I'm yet to find a way to read incoming request post body using generic IB message.

             

            For now I'm doing all my processing to read POST request, validation in Python using Django framework and then sending simple Get to PS to get data I need (doing this I kept options open to get data from other sources for chatbot) which works fine. Finally my Dialogflow based chatbot is working in PS!