on 08-25-2021 10:05 AM
Hello experts,
I need to send cXML of Sourcing award confirmation to Ariba Network. When I am sending the cXML via postman to Ariba network directly, it is working. But when I am sending the same through a simple pass through iflow, HTTP receiver adapter, I am getting error - 411 Length required.
Initially I had planned to use Ariba adapter but that doesn't support the ContractStatusUpdateRequest yet as per the response on OSS. So I am trying to find the alternative. So I tried to use simple HTTP receiver adapter and configured necessary paramters. I keep on getting 411 HTTP error. I found that HTTP receiver adapter does not pass content-length header parameter. This is a documented here.
I tried to insert the Content-Length or content-length header parameter using groovy script before end message event. But still getting 411 error. Ariba Network needs this parameter.
Can anyone suggest solution/workaround for this?
Regards,
Yayati Ekbote
Hello guys,
The issue was solved by OSS. It seems that body has to be sent as string type as per the support guy and gave the link of guided answer.
So I implemented a work around groovy script just before the end message event.
def body = message.getBody(java.lang.String);
message.setBody(body);
https://ga.support.sap.com/dtp/viewer/#/tree/2065/actions/26547:26549:28901:28748:41513:41514:41518
And this worked.
I haven't understand the logic behind it 😞 , but for now at least customer issue has been solved.
Regards,
Yayati Ekbote
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For MIME multipart message, I wrote a separate logic.
https://blogs.sap.com/2022/01/24/send-cxml-message-to-ariba-network-as-mime-multipart/
Regards,
Yayati
Hello yayatiekbote if you suspect lowercase content-length issue, did you try to add them "manually" Capital-case in content modifier as type Header?
Even I am doing something wrong trying it, it pays off reading this
HTTP Receiver Adapter - SAP Help Portal
The HTTP adapter supports only HTTP 1.1. This means that the target system must support chunked transfer encoding and may not rely on the existence of the HTTP Content-Length header.
and also
Request HeadersEnter a list of custom headers, separated by a pipe (|), that you want to send to the target system. Use an * to send all custom headers to the target system. By default, no custom headers are sent.RememberYou must have defined the custom headers in the previous flow steps like content modifiers or scripts before you mention them in the HTTP Receiver Adapter.
All Camel-specific headers (that starts with camel or org.apache.camel) and the below listed HTTP protocol headers are excluded even if you specify them.You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Yayati,
Could you please check in Postman console what headers are being sent while you are posting confirmation and try to send same in SAP CPI HTTP adapter.
Regards,
Sriprasad S Bhat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I added Content-Type, Accept etc.. and I can see them all in trace log till HTTP receiver adapter. But still same issue. It is still crying for 411 (Length required issue).
One thing I am suspecting is, Postman has Content-Length with 'C' and 'L' in caps where as CPI is converting it automatically to content-length (all in lower case). Not sure if Ariba is expecting it as 'Content-Length' and unable to understand 'content-length'.
Anyway, I have raised OSS to SAP in parallel. But still I am welcome to suggestions and ideas.
Regards,
Yayati Ekbote
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Yayati,
After adding this in content modifier make sure it is whitelisted in HTTP receiver adapter Request Headers also.
Regards,
Sriprasad Shivaram Bhat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.