No joy for the new Backendless 4 relation API on my home computer
Using the 2 examples below, I always receive the following error:BackendlessFault{ code: ‘Internal client exception’, message: ‘http://192.168.178.31:80/api/[...]/binary’ }
I am trying to add a relation of currently logged-in User with a “rsvp” column in Event table (one to many)
The data in the event and the backendlessUser objects is definitely ok, so there can’t be a problem there.
I have run an example multiple times and always without exception received an …exception (I could word that one better )
Example 1
Event event = events.get(eventIndex); // personObject retrieval is out of scope in this example
BackendlessUser backendlessUser = Global.gCurrentUser; // addressObject retrieval is out of scope in this example
ArrayList<BackendlessUser> backendlessUsers = new ArrayList<>();
backendlessUsers.add( backendlessUser );
Backendless.Data.of(Event.class).addRelation(event, "rsvp", "email=\"jure@j.j\"",
new AsyncCallback<Integer>() {
@Override
public void handleResponse(Integer response) {
Log.i( "MYAPP", "related objects have been added");
bRSVP = true;
}
@Override
public void handleFault(BackendlessFault fault) {
Log.e( "MYAPP", "server reported an error - " + fault.getMessage() );
bRSVP = false;
}
});
I have also tried to do it the other way.
Example 2:
Backendless.Data.of(Event.class).addRelation(event, “rsvp”, backendlessUsers,
new AsyncCallback<Void>() {
@Override
public void handleResponse(Void response) {
Log.i( “MYAPP”, “related objects have been added”);
}
@Override
public void handleFault(BackendlessFault fault) {
Log.e( "MYAPP", "server reported an error - " + fault.getMessage() );
}
});
with the same BackendlessFault{ code: ‘Internal client exception’, message: ‘http://192.168.178.31:80/api/[...]/binary’ } risen.
The rest of the App is working nicely so I don’t have any idea what the problem might be.
Not related, but might be helpful to your company:
I noticed that the API has a different type(Void) then the documentation provided for Backendless 4 (Integer).
While they are both the same in the first example, the second example has mixed up types (Void for Integer).
The following is from documentation (compare with the above):
Backendless.Data.of( Person.class ).addRelation( personObject, “address”, addressCollection, new AsyncCallback<Integer>() { @Override public void handleResponse( Integer response ) { Log.i( “MYAPP”, “related objects have been added”); }
https://backendless.com/docs/android/doc.html#data_relations_api_set_add_android
I hope I have been of some help at least since I keep bothering you with these questions.
I must say I am enjoying the development with Backendless very much and you guys have provided me with most joy I have ever experienced in Java development!
So thank you and I hope you keep it up!