AnsweredAssumed Answered

applyEditsAsync problems

Question asked by RobDavies on Sep 25, 2019
Latest reply on Oct 7, 2019 by gheppner-esristaff

We are constructing an app that talk directly to an unfederated Arcgis 10.61 enterprise server.

We are trying to upload data to a secure feature service but the applyEditsAsync is returning immediately and not uploading the data.

 

private void applyEdits() {
     final ListenableFuture<List<FeatureEditResult>> editResult = _fl.applyEditsAsync(); // THE PROBLEM: request does not reach the server
     editResult.addDoneListener(() -> { // RETURNS IMMEDIATELY
          try {
               List<FeatureEditResult> editResults = editResult.get(); // editResults IS EMPTY
               if (editResults != null && !editResults.isEmpty()) {
                    FeatureEditResult result = editResults.get(0);
                    if (!result.hasCompletedWithErrors()) {
                         
                         ...
                         
                         }
                    } else {
                         throw editResults.get(0).getError();
                    }
               }
          } catch (InterruptedException | ExecutionException e) {
               runOnUiThread(() -> logToUser(true, getString(R.string.error_applying_edits, e.getCause().getMessage())));
          }
     });

the GIS Server log contains the following:


FINE 25 Sep 2019 13:51:09 REST request successfully processed. Response size is 306601 characters. GRIN/GRIN_secure.MapServer
FINE 25 Sep 2019 13:51:09 REST request successfully processed. Response size is 274509 characters. GRIN/GRIN_secure.MapServer
FINE 25 Sep 2019 13:51:08 REST request received. Request size is 30 characters. GRIN/GRIN_secure.MapServer
FINE 25 Sep 2019 13:51:08 REST request received. Request size is 30 characters. GRIN/GRIN_secure.MapServer
FINE 25 Sep 2019 13:51:08 GraphicFeatureServer::HandleRESTRequest ## requestProperties = {"computeETag":true,"Aggregate":false} GRIN/GRIN_secure.MapServer
FINE 25 Sep 2019 13:51:08 GraphicFeatureServer::HandleRESTRequest ## inputJSON = {"returnAdvancedSymbols":true} GRIN/GRIN_secure.MapServer
FINE 25 Sep 2019 13:51:08 Wait time for 'GRIN.GRIN_secure.MapServer' service request is 0 milliseconds. Server
INFO 25 Sep 2019 13:51:08 Request user: test, Service: GRIN/GRIN_secure/FeatureServer Rest
FINE 25 Sep 2019 13:51:05 HTTP Referer: Not Available Server
INFO 25 Sep 2019 13:51:05 Request user: Anonymous user, Service: GRIN/GRIN_secure/FeatureServer Rest

 

I am thinking the issue may be authentication related as the log is not showing a token being passed in the request

FINE 25 Sep 2019 13:51:08 GraphicFeatureServer::HandleRESTRequest ## inputJSON = {"returnAdvancedSymbols":true} GRIN/GRIN_secure.MapServer


(log entry from 10.2.9)

FINE Sep 25, 2019, 12:41:56 PM GraphicFeatureServer::HandleRESTRequest ## inputJSON = {"returnAdvancedSymbols":false,"token":"ag6BjT8jWJKv5BzLaQO5_Hd4zGrhfqyun3PDduWM6qZet73sZ0olSPYbM_3B2b5B"} GRIN/GRIN_secure.MapServer

 

but the server is still responding with the metadata

FINE 25 Sep 2019 13:51:09 REST request successfully processed. Response size is 274509 characters. GRIN/GRIN_secure.MapServer

 

Main call:

private ServiceFeatureTable _fl;

private void loadService(final int layerId) {
     String url = _url + String.valueOf(layerId);
     AuthenticationChallengeHandler ah = new AuthenticationChallengeHandler() {
          @Override
          public AuthenticationChallengeResponse handleChallenge(AuthenticationChallenge authenticationChallenge) {
               String message = "Authentication Failed! ";
               message += authenticationChallenge.getException().getMessage();
               fireProgressEvent(SYNC_ERROR, message);
               return null;
          }
     };
     AuthenticationManager.setAuthenticationChallengeHandler(ah);
     _fl = new ServiceFeatureTable(url);
     _fl.setFeatureRequestMode(ServiceFeatureTable.FeatureRequestMode.ON_INTERACTION_CACHE);
     _fl.setCredential(_cred);
     _fl.loadAsync();
     _fl.addDoneLoadingListener(() -> {
          if (_fl.getLoadStatus().equals(LoadStatus.LOADED)) {

               uploadObservation();
                        //creates the feature and calls applyEdits()
          }
     });
}

 

Is this correct behaviour for 100.6 or am I correct and it's an issue with authentication

Outcomes