Error trying to parse null as integer in DV JSONTOXML function

Solution Verified - Updated -

Issue

  • Trying to connect to a JSON web service, get an Exception :
 WARN  [org.teiid.PROCESSOR] (Worker5_QueryProcessorQueue107) TEIID30020 Processing exception for request YlXJzLZ6YatD.16 'TEIID10072 Invalid integer format in String: '. Originally TransformationException StringToIntegerTransform.java:43. 

Environment

  • Red Hat JBoss Data Virtualization (DV) 6.3
  • View Transformation for Web Request:
BEGIN
    DECLARE STRING VARIABLES.qp = QUERYSTRING('https://myservice', 'BEST' AS mode);
    SELECT A.* FROM (EXEC wsPDB.invokeHttp(action => 'POST', request => (('{"uwi":["' || wsPDBquery.getuwi.uwi) || '"],"mode":"ALL"}'), endpoint => VARIABLES.qp, stream => 'TRUE', headers => JSONOBJECT('application/json' AS "Content-Type", CAST(teiid_session_get('token') AS string) AS "x-access-token"))) 
    AS f, XMLTABLE('/response/response' PASSING JSONTOXML('response', f.result) COLUMNS sta_id INTEGER PATH 'sta_id',  INTEGER PATH 'sta_test_nb', ) AS A;
END

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In