on 01-13-2019 11:21 AM
Hello Colleagues,
In my fullstack web ide , i was developing a business application. i couldn't do a post in the odata and i was receiving this error.
EntityProviderException: An exception of type 'IllegalStateException' occurred.","\t... 46 more","Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2 path $","\tat com.google.gson.stream.JsonReader.beginObject(JsonReader.java:385)","\tat org.apache.olingo.odata2.core.ep.consumer.JsonEntryConsumer.readSingleEntry(JsonEntryConsumer.java:85)","\t... 45 more"] }
My Service.cds code is using my.bookshop from '../db/data-model';
service CatalogService {
entity SupplierProduct @insert @read @update @delete as projection on bookshop.MarketContext.MarketLocation.MarketSPace;
entity Market @insert @read @update @delete as projection on bookshop.MarketContext.Product.ProductMaster;
entity Sales @insert @read @update @delete as projection on bookshop.MarketContext.Sales.Sales;
}
[
{
"COMPANY_ID": "C2002189",
"COUNTRY": "UNITED STATES",
"CITY": "CALIFORNIA",
"STATE_COUNTY": "NEVADA",
"PINCODE": 89108,
"MARKETVALUE": 500000,
"GENERATING_INCOME": 36000,
"MARKET_OWNER": "Ashlin Gabriel",
"START_YEAR": "2011-02-03",
"CURRENCY": "USD"
}
]
Json data that i tried to push.
and is there any other way of loading data in to the table in business application from a csv as currently the data uploader of fullstack ide is not working.
Kindly Help.!
Br,
Gabriel.
<?xml version='1.0' encoding='UTF-8'?>
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<code/>
<message xml:lang="en-US">Illegal argument for method call with message 'COMPANY_ID'.</message>
</error>
This is what i get now.! 😞
Please help me here also is there anyways we can do a post of multiple records with this . i know currently we can handle this requirement with XSODATA and XSJS but i am not sure if this is possible with the Nodejs version of cds service.
@SAP Experts please enlight us!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
From the exception it looks it is expecting an object and you are passing array. Can you try with this data
{
"COMPANY_ID": "C2002189",
"COUNTRY": "UNITED STATES",
"CITY": "CALIFORNIA",
"STATE_COUNTY": "NEVADA",
"PINCODE": 89108,
"MARKETVALUE": 500000,
"GENERATING_INCOME": 36000,
"MARKET_OWNER": "Ashlin Gabriel",
"START_YEAR": "2011-02-03",
"CURRENCY": "USD"
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
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.