[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Ftpapi] JSON capture



In the RPGLE program that makes a call to API using lib LIBHTTP, try below code

// Note:  http_debug(*ON/*OFF) can be used to turn debugging      
//        on and off.  When debugging is turned on, diagnostic    
//        info is written to an IFS file named                    
//        /tmp/httpapi_debug.txt                                  
                                                                 
   http_debug(*ON);                                               

this will get you full request and response details.

If you just want to see/save the JSON body that is formed your RPGLE. try below code

yajl_saveBuf(%trimr(qualifiedname):charvar);




On Fri, Mar 13, 2020 at 4:07 PM Tony Cesarios <tony@xxxxxxxxxxxxxxxxxxx> wrote:

Hi Scott

 

What I’m simply trying to do is that once the JSON has been built within the program and prior to going the POST I would like to capture it so I can view it when things don’t quite work out properly, ie Header, Body etc.

 

I’ve got the debug on but it doesn’t show the JSON unless it establishes a connection or attempted transmission.

 

When you deal with some 3rd parties who say use SOAPUI and test your data, it’s hard to prove to them that what has been created within the iSeries is correct etc.

 

Regards

 

 

From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx <ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx> On Behalf Of Scott Klement
Sent: Friday, March 13, 2020 2:03 AM
To: ftpapi@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [Ftpapi] JSON capture

 

There are many, many, many tools inside of HTTPAPI and YAJL. 

If you cannot be specific about what you're doing, I cannot help you.

 

On 3/11/2020 6:11 PM, Tony Cesarios wrote:

Hi Scott

 

Sorry forgot to mention I’m using HTTPAPI and YAJL.

 

Issue I have is that sending the JSON I’m getting a 500 error, which has nothing to do with it.

 

I just want to compare what I’ve created and sending out to what it looks like on SOAPUI.

 

They have provide a User and Password, but are refusing to apply our iSeries public key.

 

So basically I just need to be able to view what we are sending from the iSeries.

 

Regards

 

 

From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx <ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx> On Behalf Of Scott Klement
Sent: Thursday, March 12, 2020 8:29 AM
To: ftpapi@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [Ftpapi] JSON capture

 

Tony,

Sorry, we don't know which tool you are using, here...   can you give us more context?  

-SK

On 3/11/2020 2:18 PM, Tony Cesarios wrote:

Hi,

 

Is there anyway of capturing the JSON statements into the IFS so they can be reviewed?

 

Regards

 

 



--
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi


--

-- 
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi