BusinessObjects Board

Partial result from json response in ServiceWebREST API call

Hi,

I have a problem to extract data from json response of a ServiceWebREST API.

With SOAPUI, I generated the WADL with a xsd structure for the response (between the grammars tags) :

<?xml version="1.0" encoding="UTF-8"?>

I created the Service Web REST Datastore and import successfully the function names “values”.
In my job, I call successufully the function, and, in the traces of DS, I can read the response with all data :

13788 13780 ROW 29/01/2017 16:35:47 Transform <Query_1-Function2:a40c980> is importing row <>.
13788 13780 TRAN 29/01/2017 16:35:47 GET /_ah/api/category/v1/libraries/xxxxxx/categories/xxxxx/values?securityCode=xxxxxxxxxx
13788 13780 TRAN 29/01/2017 16:35:47 HTTP/1.1
13788 13780 TRAN 29/01/2017 16:35:47 Host: xxxxx.xxxxx.com
13788 13780 TRAN 29/01/2017 16:35:47 Content-Type: application/json; charset=utf-8
13788 13780 TRAN 29/01/2017 16:35:47 Accept: application/json
13788 13780 TRAN 29/01/2017 16:35:47 HTTP/1.1 200 OK
13788 13780 TRAN 29/01/2017 16:35:47 Cache-Control: no-cache, no-store, max-age=0, must-revalidate
13788 13780 TRAN 29/01/2017 16:35:47 Pragma: no-cache
13788 13780 TRAN 29/01/2017 16:35:47 Expires: Mon, 01 Jan 1990 00:00:00 GMT
13788 13780 TRAN 29/01/2017 16:35:47 Date: Sun, 29 Jan 2017 15:35:47 GMT
13788 13780 TRAN 29/01/2017 16:35:47 Content-Type: application/json; charset=UTF-8
13788 13780 TRAN 29/01/2017 16:35:47 Set-Cookie *******
13788 13780 TRAN 29/01/2017 16:35:47 Set-Cookie *******
13788 13780 TRAN 29/01/2017 16:35:47 X-Content-Type-Options: nosniff
13788 13780 TRAN 29/01/2017 16:35:47 X-Frame-Options: SAMEORIGIN
13788 13780 TRAN 29/01/2017 16:35:47 X-XSS-Protection: 1; mode=block
13788 13780 TRAN 29/01/2017 16:35:47 Server: GSE
13788 13780 TRAN 29/01/2017 16:35:47 Alt-Svc: quic=":443"; ma=2592000; v=“35,34”
13788 13780 TRAN 29/01/2017 16:35:47 Accept-Ranges: none
13788 13780 TRAN 29/01/2017 16:35:47 Vary: Accept-Encoding
13788 13780 TRAN 29/01/2017 16:35:47 Transfer-Encoding: chunked
13788 13780 TRAN 29/01/2017 16:35:47
13788 13780 TRAN 29/01/2017 16:35:47 265
13788 13780 TRAN 29/01/2017 16:35:47 {
13788 13780 TRAN 29/01/2017 16:35:47 “kind”: “xxx#categoryValueList”,
13788 13780 TRAN 29/01/2017 16:35:47 “items”: [
13788 13780 TRAN 29/01/2017 16:35:47 {
13788 13780 TRAN 29/01/2017 16:35:47 “kind”: “xxx#categoryValue”,
13788 13780 TRAN 29/01/2017 16:35:47 “name”: “val1”,
13788 13780 TRAN 29/01/2017 16:35:47 “value”: “Q8rO7mG4aGnXrtb4VT”
13788 13780 TRAN 29/01/2017 16:35:47 },
13788 13780 TRAN 29/01/2017 16:35:47 {
13788 13780 TRAN 29/01/2017 16:35:47 “kind”: “xxx#categoryValue”,
13788 13780 TRAN 29/01/2017 16:35:47 “name”: “val2”,
13788 13780 TRAN 29/01/2017 16:35:47 “value”: “Q8rO7QJ00ypNnh0hL3”
13788 13780 TRAN 29/01/2017 16:35:47 },
13788 13780 TRAN 29/01/2017 16:35:47 {
13788 13780 TRAN 29/01/2017 16:35:47 “kind”: “xxx#categoryValue”,
13788 13780 TRAN 29/01/2017 16:35:47 “name”: “val3”,
13788 13780 TRAN 29/01/2017 16:35:47 “value”: “Q8rO85W0NsGvU89VqW”
13788 13780 TRAN 29/01/2017 16:35:47 },
13788 13780 TRAN 29/01/2017 16:35:47 {
13788 13780 TRAN 29/01/2017 16:35:47 “kind”: “xxx#categoryValue”,
13788 13780 TRAN 29/01/2017 16:35:47 “name”: “valman1”,
13788 13780 TRAN 29/01/2017 16:35:47 “value”: “Q8rR1Ex1oQxDpWybZB”
13788 13780 TRAN 29/01/2017 16:35:47 },
13788 13780 TRAN 29/01/2017 16:35:47 {
13788 13780 TRAN 29/01/2017 16:35:47 “kind”: “xxx#categoryValue”,
13788 13780 TRAN 29/01/2017 16:35:47 “name”: “valman2”,
13788 13780 TRAN 29/01/2017 16:35:47 “value”: “Q8rU6AP5L4nUUNzltq”
13788 13780 TRAN 29/01/2017 16:35:47 }
13788 13780 TRAN 29/01/2017 16:35:47 ],
13788 13780 TRAN 29/01/2017 16:35:47 “etag”: ““SK9rTZDwMWQziLS1EaQOSfErSSg/BFr4zYLxnDCYuxn9Ger0L1DMlZo””
13788 13780 TRAN 29/01/2017 16:35:47 }
13788 13780 TRAN 29/01/2017 16:35:47 0
13788 13780 ROW 29/01/2017 16:35:47 Transform <Query_1-Function2:000000000A40C980> is exporting row <,0,NULL,0>.

But when I try to get the results in a table (after schema unnested) or in the debugger (breakpoint just after the call of the API function), I can see only the correct values for “kind” (“xxx#categoryValueList”) and “etag” (“SK9rTZDwMWQziLS1EaQOSfErSSg/BFr4zYLxnDCYuxn9Ger0L1DMlZo”) fields.
The “items” fields are null (“kind”, “name” and “value” are null).

I tried to generate a different xsd for the response but with always the same result.
There is no error returned in DataServices.

Have you any idea to solve my problem ?
Thanks in advance.


vegaelce (BOB member since 2009-02-14)

Version of DS?
Have you tried dumping the result straight to an XML file with no un-nesting?

  • E

eepjr24 :us: (BOB member since 2005-09-16)

Hi,

Version of DS : 4.2 SP6

I tried an output directly in an XML file (with no un-nesting) but the result is the same :
the first (“kind”) and the third (“etag”) fields are OK but the “item” field is empty.


vegaelce (BOB member since 2009-02-14)

Well, I don’t see anything wrong with your JSON or the output in the trace. Maybe someone else has input? Otherwise I would open a ticket with SAP.

  • E

eepjr24 :us: (BOB member since 2005-09-16)

I am facing similar issue. Did any one find a solution or work around for this?

Function call for the service returns output only for top level fields in the response. Any nested schema fields are sent out as null.

Below is the expected response format for function call
{
“requestId”: “”,
“result”: [ {
“batchId”: ,
“importId”: “”,
“status”: “”
}],
“success”: true
}

BODS is returning value only for requestid and success but not for nested columns.
When I set trace transform on I see the correct response in the trace log.

Also I have another API Call, it returns only a nested schema, there are no top level fields. Facing the same issue with it as well, in this case its coming all nulls. Below is expected response format.

{“token”: {
“access_token”: “”,
“expires_in”: “”
}}

Appreciate your help.


ravisawa (BOB member since 2017-10-06)