You can translate the question and the replies:

JSON data source for POST operation

Hi, My Intention : To create an Denodo REST service with POST method for inserting data to Oracle through denodo service. I've already created Denodo derived view (Updateable) and exposed REST API which has only 3 attributes INSRD_NM, INSR_NM_MOD, STAGE https://<<Server:Port>>/CUST_GROUP/views/CUST_GROUP Also, IN webservices, resources tab, made all attributes as part of Input & Output with Authentication as "None" and default representation As JSON. I'm able to retrieve data in json format even with input parameters for specified Name. Tried following to create a service with POST method ---------------------------------------------------------------------- 1. Created JSON as data source and specified URL (as above) and method as POST 2. Enabled proxy in the proxy tab 3. Add below as POST body \{ "INSRD_NM": "<<Name>>", "INSRD_NM_MOD": "<<Modified Name>>", "STAGE": <<Stage #>> \} 4. I also tried with this URL https://<<Server:Port>>/CUST_GROUP/views/CUST_GROUP?INSRD_NM=karthik&INSRD_NM_MOD=karthik&STAGE=3 5. I also tried with this \{ "INSRD_NM": "@INSRD_NM", "INSRD_NM_MOD": "@INSRD_MOD_NM", "STAGE": "@STAGE" \} Some how I couldn't succeed. Getting HTTP 503 error with Proxy. I could able to save the jsonsource without proxy, but getting error while creating base view. But, getting error as "Unable to Obtain Data Structures" Let me know if any additional information is required. Also, how does Denodo Kindly help!! Regards
user
03-09-2017 10:38:22 -0400
code

3 Answers

Hi, I am able to create JSON datasource using POST connection, by providing the POST body with correct syntax. Special characters like ‘{‘,’}’,’@’ should be escaped by using ‘\’ character, unless they are used in variable definition. In your case, I see that the starting and ending braces are not escaped with ‘\’. I would also verify the configuration provided for the proxy is valid. Additionally, when using ‘https’ connection, verify if the service is using any authentication method and provide the same in ‘Authentication’ tab while creating JSON datasource. You can refer to the knowledge base article about ‘[Error creating JSON data source with "Post Body" parameters](https://community.denodo.com/kb/view/document/Error%20creating%20JSON%20data%20source%20with%20%22Post%20Body%22%20parameters?category=Common+Errors)’ and the community question about '[JSON https authentication](https://community.denodo.com/answers/question/details?questionId=9060g000000XdSZAA0&title=JSON+from+https)' for more information. Hope this helps!
Denodo Team
04-09-2017 08:43:37 -0400
code
Thanks for your reponse. I tried below combination but still facing the same error as"Not able to obtain structure". Not used any authenticaiton, hence not mentioned in Json Data source. https://<<server:port>>/CUST_GROUP/views/CUST_GROUP?INSRD_NM=@{INSRD_NM}&INSRD_NM_MOD=@{INSRD_NM_MOD} --> As URL ***Post Body ** \{ "INSRD_NM": "@INSRD_NM", "INSRD_NM_MOD": "@INSRD_NM_MOD" \} Error: --------------------------------------------------------------------------------------------------- 4 [SwingWorker-pool-1-thread-7] ERROR 2017-09-03T17:18:39.932 com.denodo.vdb.admin.model.introspect.VQLSourceIntrospectionService - Error introspecting JSON source com.denodo.vdb.admin.model.vdbserverproxy.VDBServerProxyException: No content to map due to end-of-input at [Source: java.io.InputStreamReader@37d58411; line: 1, column: 1] --------------------------------------------------------------------------------------------------- 1. When I enable the proxy, json source is not getting saved 2. Without proxy, am able to save but getting above error while creating base view. 3. I've used same proxy details for ready XML as source and it works. Could you please tell me what specifications be mentioned in "Webservice" Resources tab? Is it Input/Output/Mandatory or what combination for insert and select? Regards!
user
04-09-2017 13:58:05 -0400
Hi, It is required to have an output schema for the web service if you want to create a base view using POST method. If the intention is to just insert data, you could use any of the third party REST clients, instead of creating a base view using POST method. Hope this helps!
Denodo Team
12-09-2017 06:29:52 -0400
code
You must sign in to add an answer. If you do not have an account, you can register here