0 Replies Latest reply on Jun 9, 2014 5:35 PM by lightsailpro

    remote xml (REST service) with custom header not working

    lightsailpro

           I have a ElasticSearch installation with a xml plugin. The plugin returns xml instead of JSON. But the xml plugin requires a custom header (Accept: application/xml). In teiid designer 8.5 RC1, I was able to add the header and do the xml mapping. The xml is also generated. But at last step, I got error - "could not read from source when writing ESCarsSource.xml". The generated xml call does not have the custom header (Accept: application/xml) that I added. Without the header, it will be JSON. So is this a bug? Is there a workaround for the xml call to have the custom header. Thanks.

       

      SELECT

      A.price AS price, A.color AS color, A.make AS make, A.sold AS sold

      FROM

      (EXEC ESCarsSource.invokeHttp('GET', null, 'http://server1:9200/cars/_search?pretty=true', 'TRUE')) AS f, XMLTABLE(XMLNAMESPACES(DEFAULT 'http://elasticsearch.org/ns/1.0/') , '/root/hits/hits/source' PASSING XMLPARSE(DOCUMENT f.result) COLUMNS price string PATH 'price/text()', color string PATH 'color/text()', make string PATH 'make/text()', sold string PATH 'sold/text()') AS A