Skip Navigation

Issues with calling SRW API

  1. Using null values as arguments of SR360 API methods.

        When null value is passed as argument of SR360 API Java-Javascript bridge will not be able to find matching method and thus execute it.

        The only exception is SrwOSGiApi.callOSGIService. For maintain backward compatibility, it is allowed to pass null as third argument for this method, nevertheless it is recomended that you use the two-argument version of this method when the third argument is not needed.

        In all other cases the null argument will cause that method will not be called, and following exception will be thrown:

SrwApi.showInEmu(null, null); Uncaught java.lang.NullPointerException: null

         

  1. Using argument type which cannot be converted to matching java type

        Javascript strings are not automatically converted to suitable Java types. Ex. '123.4' is passed to java as string, not a number.

        In JxBrowser all numbers are passed to Java as Double type.

        For easier usage SR360 API provides additional methods with arguments of the String or Double type and those arguments are parsed to the expected type.