Original Message:
Sent: Wed July 19, 2023 02:42 PM
From: Steve Linn
Subject: JSON Array request in API Connect
Hi Anusha,
So very strange. I keep getting "no permission to post to this site", but apparently it must have something to do with the text I'm attempting to post.
Looking at the packet capture, your JSON is well formed. I see that the message is being sent using chunked encoding. Does your backend accept chunked encoding? It consists of some length bytes that precede and follow the actual payload when using chunked encoding. There is a checkbox toward the bottom of the invoke policy properties that by default is enabled for allowing chunked uploads. Please disable it and see if that resolves your issue.
Best Regards,
Steve Linn
------------------------------
Steve Linn
Senior Consulting I/T Specialist
IBM
Original Message:
Sent: Wed July 19, 2023 02:35 PM
From: Steve Linn
Subject: JSON Array request in API Connect
Hi Anusha,
Sorry but I've having issues posting an answer. Trying this out as a simple test
Best Regards,
Steve
------------------------------
Steve Linn
Senior Consulting I/T Specialist
IBM
Original Message:
Sent: Wed July 19, 2023 06:22 AM
From: Anusha Pudari
Subject: JSON Array request in API Connect
Hi @Steve Linn
Could you please check the packet capture that I shared with you in my previous post.
------------------------------
Anusha Pudari
Original Message:
Sent: Tue July 18, 2023 06:02 AM
From: Anusha Pudari
Subject: JSON Array request in API Connect
Hi Steve,
Please find the attached packet capture without ssl session keys.
Destination IP: 10.69.34.104
------------------------------
Anusha Pudari
Original Message:
Sent: Mon July 17, 2023 04:43 PM
From: Steve Linn
Subject: JSON Array request in API Connect
Hi Anusha,
I used Wireshark on your packet capture and searching for the text POST or GET I'm not finding anything that isn't DataPower specific (webgui, etc). What is your url to your API? Assuming I can't find that in the capture, please add a filter of host w.x.y.z
where w.x.y.z is the IP of your invoke target-url so we'll be able to only capture traffic from DataPower to your backend and will not capture internal webgui traffic.
Best Regards,
Steve Linn
------------------------------
Steve Linn
Senior Consulting I/T Specialist
IBM
Original Message:
Sent: Mon July 17, 2023 11:45 AM
From: Anusha Pudari
Subject: JSON Array request in API Connect
Hi Steve,
There is only one policy (i.e., the log policy) in my API prior to the invoke policy. Please find the attached packet capture and SSL session key.
------------------------------
Anusha Pudari
Original Message:
Sent: Mon July 17, 2023 08:46 AM
From: Steve Linn
Subject: JSON Array request in API Connect
Hi Anysha,
Are there any other policies in your API prior to the invoke policy? Can you do a packet capture from your DataPower appliance to the back, with ssl session keys if a https connection?
Best Regards,
Steve Linn
------------------------------
Steve Linn
Senior Consulting I/T Specialist
IBM
Original Message:
Sent: Sat July 15, 2023 04:54 AM
From: Anusha Pudari
Subject: JSON Array request in API Connect
Hi All,
I am experiencing an issue when using a JSON Array request in API Connect. Below is a description of the problem.
I have developed an API with a backend URL configured in the invoke policy. However, when testing the API using the provided request, I expected a successful response from the backend, but instead, I received an message stating "Incorrect JSON Format " from the backend.
Request:
{
"UniqueID": "xxxxxx",
"Type": "xx",
"Persons": [
{
"PersonType": "x",
"DetailsList": [
{
"PersonalDetails": {
"FirstName": "xxxxxxx",
"LastName": "xxxxxxxx"
},
"AdditionalDetails": {
"Education": "xxxxxxx",
"BankList": [
{
"Bankname": "xxxx",
"BankBranch": "xxxx"
},
{
"Bankname": "xxxx",
"BankBranch": "xxxx"
}
]
},
"Address": {
"permanentAddress": "xxxx"
}
}
]
}
]
}
Response:
{
"status": "200",
"MessageDesc": "Incorrect JSON format"
}
However, when I directly tested the backend with the same request, I received the following response:
Backend Response:
{
"status": "200",
"result": [
{
"MessageDesc": "Successfully inserted"
}
]
}
Please note that the request data is stored in the context variable, which reflects the actual content I used to hit the API.
The backend URL configured in DataPower works fine as expected, and when the DataPower URL is configured in the invoke policy, it also works fine. However, when I configure the direct backend URL in API Connect, it is not functioning as expected.
------------------------------
Anusha Pudari
------------------------------