yes it is possible. You need to set up the security mode for the communication. If the security mode has not been established, the access to the location object will be refused. You will get an exception if you add try/catch.
The method to use when connecting to Qlik Sense Desktop is methodAsDirectConnectionToPersonalEdition();