You can translate the question and the replies:

Rest API throws error while testing it through Denodo Testing Tool

I tried to expose a rest webservice something like the one mentioned below. https://denodous-dev.xxx.com:1010/server/sample_dev/api_v1/views/project?$count=9999999 But facing a below error when run through Denodo Testing Tool ** com.google.gson.stream.MalformedJsonException: Unterminated string at line 1 column 16139 path $[19].ProjectStatusChangeComment** at com.denodo.connect.testing.engine.qualifier.WebServiceProcessor.process(WebServiceProcessor.java:96) at com.denodo.connect.testing.engine.directive.AbstractQualifiedDirective.processQualifiers(AbstractQualifiedDirective.java:93) at com.denodo.connect.testing.engine.directive.AbstractQualifiedDirective.processQualifier(AbstractQualifiedDirective.java:117) at com.denodo.connect.testing.engine.directive.ResultsDirective.doProcess(ResultsDirective.java:72) at com.denodo.connect.testing.engine.directive.AbstractDirective.process(AbstractDirective.java:54) at com.denodo.connect.testing.engine.TestExecutor.executeTest(TestExecutor.java:139) at com.denodo.connect.testing.engine.TestExecutor.execute(TestExecutor.java:116) at com.denodo.connect.testing.engine.TestExecutor.execute(TestExecutor.java:85) at com.denodo.connect.testing.engine.TestExecutor.execute(TestExecutor.java:100) at com.denodo.connect.testing.engine.TestExecutor.execute(TestExecutor.java:87) at com.denodo.connect.testing.engine.TestExecutor.execute(TestExecutor.java:67) at com.denodo.connect.testing.TestRunner.run(TestRunner.java:158) at com.denodo.connect.testing.TestRunner.main(TestRunner.java:108) ** But when i copy and paste the url in a browser seperately, it works without any error.** Please help me to understand and rectify this. Thanks in advance

1 Answer

Hi, I was able to run a REST webservice test successfully by providing the REST API URL in the **%EXECUTION[ws] **and **%RESULTS[ws] ** section like : ``` %EXECUTION[ws] http://<host>:<post>/server/<database_name>/<rest api>/views/<viewname>?$format=json # --------------------------------------------------------------------------- %RESULTS[ws] http://<host>:<post>/server/<database_name>/<rest api>/views/<viewname>?$format=json ``` The error **MalformedJsonException** usually occurs when there is an extra character at the end of a JSON. Hence I would make sure there is no unnecessary character in the JSON input provided if any. You can take a look at the Knowledge Base article [Denodo Testing Tool - User Manual](https://community.denodo.com/docs/html/document/denodoconnects/8.0/en/Denodo%20Testing%20Tool%20-%20User%20Manual#h.6i8q07lfzuca) for more information. Hope this helps!
Denodo Team
02-03-2021 07:26:59 -0500
You must sign in to add an answer. If you do not have an account, you can register here