My hosted web service is a very simple web service:
public class GetCurrentTimeService implements IBackendlessService {
public long getCurrentTimeinMillis(){
return System.currentTimeMillis();
}
}
But whenever i am trying to invoke it in my Android code: Backendless.CustomService.invoke(“GetCurrentTime”, “1.0”, “getCurrentTimeinMillis”, null); I am getting the following exception.
ExceptionClass:“ClassCastException” {Msg:“weborb.reader.StringType cannot be cast to weborb.reader.ArrayType”, Cause:“none”}
Am I invoking it wrong?
Please try code example added in InvocationExample class (it included into generated android sdk):
public class InvocationExample
{
public static void main( String[] args )
{
GetCurrentTimeService.initApplication();
GetCurrentTimeService getCurrentTimeService = GetCurrentTimeService.getInstance();
Object result = getCurrentTimeService.getCurrentTimeinMillis();
System.out.println( result );
}
}
Android Studio is unable to find the GetCurrentTimeService class.
I included the generated SDK in the libs folder and synced the gradle files but it still failed to recognize the class.
I was able to call the function by including the java file in my code though.