ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Capture Request/Response JSON Using IWS Server and Deployed Services

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Capture Request/Response JSON Using IWS Server and Deployed Services

    We have recently become a "provider" of data via web services for the first time. We created an IWS server on the Power 9 system with no issue. I created the service programs and deployed services for all the web services (thanks Scott Klement for the tutorial). All is working great.

    I would like to capture the request and response JSON strings for historical purposes and store in the IFS. I'm not sure how to do that. Attached are a couple of screen shots of my deployed service for our basic customer inquiry web service.

    I would like to capture the "customerReq" and "customerInfo" data into an IFS folder so we have a history of what is requested and the responses for those requests. I will have a purge process to clean them up periodically.

    I'm not sure what I'm missing....

    Thanks!
    Attached Files

  • #2
    I have never tried to do that...

    That said, there was a new feature added via PTF to create logs of the HTTP transactions. I saw it on the following site:


    If you click on "HTTP message logging" it'll take you to this site:
    HTTP message logging logs the messages that are being exchanged between web service clients and the web services server.


    Again, I haven't tried it -- but it seems to say that if you enable this feature it'll create a log of everything it sends/receives. You could potentially write a program to process that log and extract the payloads as needed.

    Comment


    • #3
      Thanks Scott. I'll take a look.

      Comment


      • #4
        That will work! When enabled it will write to a message log text file "messages.log" here in the IFS:

        \www\<rest server name>\wlp\usr\servers\<rest server name>\logs

        It will have the request body and the response body included. There are a bunch of other data included in the log file (dates, times, host names, etc.) but this will work as I really needed something that I could look at if there were questions from the user about what is exactly being received and the response from the IBMi side.

        Thanks again!!!!

        Comment

        Working...
        X