Article - CS302464

Error "Message :: Illegal character in query at index <index number>:" when service is invoked in ThingWorx Composer

Modified: 19-Mar-2023   


Applies To

  • ThingWorx Platform 8.4 to 9.3

Description

  • When inbuilt GetJSON() service is invoked in a custom service, it fails with below error in /ThingworxStorage/logs/ApplicationLog.log
[L: ERROR] [O: c.t.w.BaseService] [I: ] [U: admin] [S: ] [T: https-jsse-nio-8443-exec-7] [context: com.thingworx.webservices.context.HttpExecutionContext@5868aac3][message: Execution error in service script <[javascript service name]> :: Illegal character in query at index <index number>: <URL>]
  • The Resources["ContentLoaderFunctions"].GetJSON(params) service fails and throws below error message as output when executed in ThingWorx Composer:
Illegal character in query at index <index number>: <URL> - See Script Error Log for more details
  • When the URL provided as params in GetJSON() service contains a space or double quotes, it fails with below error in /ThingworxStorage/logs/ScriptLog.log
[L: ERROR] [O: S.c.t.d.e.DSLProcessor] [I: <Thing Name>] [U: Administrator] [S: ] [T: http-nio-80-exec-6] [message: Execution error in service script [ContentLoader] :: Illegal character in query at index<index number>: <URL> 
  • Unable to send text messages using Twilio Extension SendMessage service with following error displayed on Composer:
Illegal character in query at index <index number>: <URL> - See Script Error Log for more details
  • Not able to send SMS text messages with space characters
  • Works on Postman
  • How to build URL for GetJSON() params
This is a printer-friendly version of Article 302464 and may be out of date. For the latest version click CS302464