cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Getting error in SAP Integration Suite IFLOW - Unresolved variable : request.formparam.code

gopalkrishna_baliga
Participant
0 Kudos
789

Hi Experts,

I have created a new https to http iflow in SAP integration suite. It is calling POST API in teh receiver side. I have separately tested the receiver API in POSTMAN and works. It has input json and returns json payload. 

gopalkrishna_baliga_0-1750238269349.png

When call the end point url in POSTMAN i see the below error in the step for calling the receiver http service.

com.sap.it.rt.adapter.http.api.exception.HttpResponseException: An internal server error occured: Status code:400; Reason: { "errorMessage": "Unresolved variable : request.formparam.code", "errorReason":"Missing a Parameter", "errorStatus":400 }

Why is this error? what am i missing?

My Sender HTTPS config;

gopalkrishna_baliga_6-1750239429478.png

 

My receive HTTP config is as below:

gopalkrishna_baliga_1-1750238637310.png

My content modifer config:

gopalkrishna_baliga_2-1750239203839.pnggopalkrishna_baliga_3-1750239223927.pnggopalkrishna_baliga_4-1750239251598.png

Integration flow config:

gopalkrishna_baliga_5-1750239311239.png

Thanks

Gopal

Accepted Solutions (0)

Answers (2)

Answers (2)

RameshVaranganti
Participant
0 Kudos

This still on going.. lets break down the issue like below

  • Do not connect any VPN.
  • In the postman, Directly call Token URL and pass the parameters.  Note: This postman trigger endpoint to Token URL only not the actual business endpoint URL.
    • Check what response is coming and validate CURL information from postman.
  • If above test is successfull, then replicate same token connection test from SAP CPI by passing same CURL information. with GET method.

Share the Token URL test results from Postman and also CPI.

Note: You are not calling actual endpoint. Only token URL from CPI and also Postman without any VPN connection.

I hope this will give clear difference .

RameshVaranganti
Participant
0 Kudos

Request Header is empty in receiver adapter. Check what you are passing when calling directly from the postman. Makesure same is in the receiver adapter also.

 

 

RameshVaranganti_0-1750306987475.png

 

gopalkrishna_baliga
Participant
0 Kudos

Hi RameshThanks for your suggestion. I have added the Request Headers. But Still getting same error.

gopalkrishna_baliga_0-1750321861590.png

 

RameshVaranganti
Participant
0 Kudos
@gopalkrishna_baliga Can you share the curl information from the postman where target point is working directly
gopalkrishna_baliga
Participant
0 Kudos

Hi Ramesh,

Pls find the CURL info from POSTMAN

curl --location --request POST 'https://apis-XXXXXXXXXXXXXXXXcredit/v1/get-cwp-data' \
--header 'Authorization: Bearer XXXXXXXXXXXXXX' \
--header 'Content-Type: application/json' \
--data-raw '{
"IWRAPDet": [
{
"MaterialId": "94563D"
}
]
}'

 

Please see the screenshot from postman for the receiver API.

gopalkrishna_baliga_0-1750389183029.png

gopalkrishna_baliga_1-1750389281191.png

gopalkrishna_baliga_3-1750389449456.png

Input payload

gopalkrishna_baliga_2-1750389337391.png

Output result:

gopalkrishna_baliga_0-1750407592316.png

 

 

Thanks

Gopal

 

 

 

gopalkrishna_baliga
Participant
0 Kudos

Hi Ramesh, Please also check more details of the error. Do we need to whitelist the receiver api endpoint url in integration suite? 

If yes where do we do this?

Error details via trace: 

gopalkrishna_baliga_0-1750411598557.png

gopalkrishna_baliga_1-1750411703448.png

gopalkrishna_baliga_6-1750412125923.png

 

gopalkrishna_baliga_2-1750411756283.png

gopalkrishna_baliga_3-1750411799906.png

gopalkrishna_baliga_5-1750412037509.png

Regards

Gopal

gopalkrishna_baliga
Participant
0 Kudos

duplicate response. so removed

RameshVaranganti
Participant
0 Kudos
in the request header add * and also share oAuth config in security material.
gopalkrishna_baliga
Participant
0 Kudos

Hi Ramesh

   I have used * for Request headers in receiver HTTP. But still getting the same error. 

gopalkrishna_baliga_0-1750419391215.png

 

gopalkrishna_baliga_0-1750418493671.png

My security materila for receiver OAUth

gopalkrishna_baliga_1-1750418563641.png

gopalkrishna_baliga_2-1750418739313.png

gopalkrishna_baliga_1-1750419459505.png

 

Thanks

Gopal

 

RameshVaranganti
Participant
0 Kudos
Can you try to call the token URL directly with HTTP and capture the response and see what you are getting, afer that try to call the API by adding previous response in the header.
gopalkrishna_baliga
Participant
0 Kudos

Hi Ramesh

   I created a new iflow to get token as suggested by you.

gopalkrishna_baliga_1-1750657384779.png

   I am not getting the token and again getting the same error.

   Looks like SAP integration suite is not able to call the receiver API end point url.

   So do we need to whitelist the receiver API host somewhere in integration suite? 

gopalkrishna_baliga_0-1750657321909.png

Thanks

Gopal

 

RameshVaranganti
Participant
0 Kudos
hi when you call endpoint directly from postman, are you connected to vpn. If yes disable VPN and test. If it is working or not. Regarding token iflow failure from SAP CPI, what is the error in the CPI, any HTTP error response body in CPI?
gopalkrishna_baliga
Participant
0 Kudos

Hi Ramesh,

I can see only this error text in CPI:

Error Details
com.sap.it.rt.adapter.http.api.exception.HttpResponseException: An internal server error occured: HTTP operation failed invoking https://apisXXXXXXXXXXX/v1/auth/token with statusCode: 400. The MPL ID for the failed message is : AGhY5yO_YX6BGp2Li8Z_uje8g8JD
 
I tried calling the receiver API without VPN. It works in POSTMAN but getting same above error when run using CPI without VPN.

Thanks

Gopal

 

RameshVaranganti
Participant
0 Kudos

Hi Gopal, As you mentioned you have received statusCode: 400 , I hope you have HTTP Error response body attachment in SAP CPI Monitoring. Can you let us know what you have in that attachment

Ramesh

 

 

gopalkrishna_baliga
Participant
0 Kudos

Hi Ramesh

  Below is error response body attachment:

gopalkrishna_baliga_0-1750834941360.png

gopalkrishna_baliga_1-1750835016343.png

 

 

 

RameshVaranganti
Participant
0 Kudos

Let’s break down the issue to find out the root cause.

  • Disconnect any VPN connection.
  • In the Postman call the Token url endpoint directly not from authorization tab. Check the connection and validate CURL.
  • Replicate the same in SAP CPI by calling the token URL with above postman CURL values.

Note this test is only calling token URL to fetch token value. Once this is working we can check next.

gopalkrishna_baliga
Participant
0 Kudos

Hi Ramesh,

  I tried as you have suggested. in my iflow i added steps to get token and then pass the token to the receiver API.

 This iflow will just get the token value and pass that to the calling API at the end.

This works fine.

Then i included this in my original iflow and tested in POSTMAN calling this CPI, i am getting response back.

The input payload is as below:

{
    "IWRAPDet": [
        {
            "MaterialId""999067"
        }
    ]
}
 
The output response payload
{
    "IWRAPDet": [
        {
            "Mandt""",
            "MaterialId""999067",
            "AvailableSite""M001",
            "AvailableQty""7"
        }
    ]
}
 
Now the question is why I am not able to get response from the same receiver API when i use oAuth credentials from Security material.
I beleive that using OAuth credentials from security material should automatically fetch token and pass the same internally.
What is the use of using OAuth credentials in Security material in SAP CPI then if its not serving its purpose?
 
Please help!

 Thanks

Gopal

 

RameshVaranganti
Participant
0 Kudos

Hello Gopal,

So now you are able to get the data when you make two separate calls one is for token and another one is api(token value from previous call).

Now lets check what all are the curl values when passing to token API endpoint fetching the token ?

gopalkrishna_baliga
Participant
0 Kudos

Hi Ramesh

   The Curl info in POSTMAN for token is

curl --location --request POST 'https://apisXXXXXXXXXX/v1/auth/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'response_type=token' \
--data-urlencode 'client_id=6XXXXXXXXXXXXXXXXXXXXXXXXXX' \
--data-urlencode 'client_secret=QXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
 
How is this going to help?
 
When my original iflow has only 2 steps: content modifier and then request reply how will this token help?
 
The HTTP adapter for the receiver I have given OAuth client credentials.
 
Thanks
Gopal 
 
 
 

 

 

RameshVaranganti
Participant
0 Kudos

in the CURL you have header 'Content-Type: application/x-www-form-urlencoded' \ , can you have same in oAuth also

RameshVaranganti_0-1751288789813.png

 

gopalkrishna_baliga
Participant
0 Kudos

Hi Ramesh

   I already tried using the Content-Type but still he same error!

gopalkrishna_baliga_0-1751363086804.png

 

gopalkrishna_baliga_1-1751363284137.png

Thanks

Gopal

gopalkrishna_baliga
Participant
0 Kudos

Hi Ramesh

   Finally i am able to resolve the issue. Now its working.

   This is my findings:

     In the Auth crendentials that we create in Security material

  1.    We need to select "Send as body parameter" for Client Authentication.
  2.    We need to select " application/x-www-form-urlencoded" for Content Type. 

gopalkrishna_baliga_0-1751443804768.png

In the Content-Modifier before request reply step we need to delete the header parameter CamelHttpUri

gopalkrishna_baliga_0-1751449364864.png

On the other hand, if we select "Send as request header" for Client Authentication  and "application/json" for Content Type in our Auth crendentials that we create in Security material then it does not work and we get the original error: 

com.sap.it.rt.adapter.http.api.exception.HttpResponseException: An internal server error occured: Status code:400; Reason: { "errorMessage": "Unresolved variable : request.formparam.code", "errorReason":"Missing a Parameter", "errorStatus":400 }

   This may be a limitation from SAP side. Is this true?

Thanks

Gopal