@Spy could you please share with me the Body string which worked for you at the end? I’m having the same error. When I send the RESTful HTTP Call in the Query URL, everything works fine. When I’m sending it in the Body, I’m getting the error:
But if I change anything small in the formatting, such as removing a line break, or just removing the empty line, I get the ‘expected string or buffer’ error. The problem I’m having is that in the Tomcat Integration framework I’m using, everything is XML based and I have to convert it to json, so I’m unable to influence the formatting of the passing json body content. Do you have any idea of how I could overcome the issue?
@rmehta I finally made it working with some code changes which I will document and share later on. However, now I’m getting a next validation message from ERPNext:
‘ValidationError: Max 100 rows for Stock Reconciliation.\n"]“,”_server_messages":“["Removed items with no change in quantity or value.", "Max 100 rows for Stock Reconciliation."]”}’
Is this a general restriction that only max 100 rows in a document are allowed? Can I change that setting?
@David_Stegnitz its designed to prevent web timeouts, maybe you should be able to bypass this by passing a flag. Do you want to try this? We can add it in the core product.
As follows a summary of the changes we have done in the ERPNext Code:
Issue: There is an error appear “ValueError: No JSON object could be decoded” when data is sent from SAP to ERPNext in http request body.
Root cause: Http request is not well formed on SAP side, as result no data is coming to ERPNext.
Description: The issue was fixed on SAP side by forming http request which ERPNext could process.
Notes:
Http request is still coming to ERPNext not completely in expected format: the data are present in request body but not in form data.
I’ve added the following code to ERPNext to handle this case:
Also in regards to the max 100 row Validation in the Stock Reconciliation Document, we have commented out the following code part:
75> if len(self.items) > 100:
76> frappe.throw(_(“”“Max 100 rows for Stock Reconciliation.”“”))
@rmehta If it would be possible to include the first HTTP change to the core version as well as to add an option to submit a flag thru the HTTP call to eliminate the 100-row validation, that would be great.