/** * Verifies the credentials * * @param username * @param password * @return * @throws NoSuchAlgorithmException * @throws XmlPullParserException * @throws IOException */ public boolean VerifyCredentials(UserCredentials credentials) throws CWException { Boolean verified; try { verified = SoapPrimitiveToBoolean( (SoapPrimitive) PerformSOAPCall( "VerifyCredentials", new PropertyInfo[] { CreatePrimitivePropertyInfo("username", credentials.getUsername()), CreatePrimitivePropertyInfo( "passwordhash", HashUtils.HashPassword(credentials.getPassword())), CreatePrimitivePropertyInfo("control", "CWRocks2008") }, null /*new IEnvelopeSetupCallback(){ @Override public void Setup(SoapSerializationEnvelope env) { new MarshalBoolean(_namespace, "VerifyCredentialsResponse", 1).register(env); } }*/ )); return verified; } catch (Exception e) { e.printStackTrace(); throw new CWException(e.getMessage()); } }
/** * Posts an asynchronous UploadGpx request. * * <p>This posted request is not handled the same way a CurrentPosition(CP) request is handled. * CP-Requests are collected and once every few seconds or even minutes they are transmitted at * once. The UI does not get immediate information about the status of the request. This is not * the way a GPX Request should be processed. The request should be handled immediatly (also if * other queued requests are waiting), the user should get an immediate status response and should * be notified on completion. So this more handled like a synchronous request, but without * blocking the calling thread. This kind of request is called "priority request", they are * handled by a second request queue which is prioritized by the worker thread */ public void PostGPXUploadRequest( String username, String password, String trackName, String gpxData, IUiCallback uiCallback) throws CWException { try { Request gpxRequest = new UploadGPXRequest( username, HashUtils.HashPassword(password), trackName, gpxData, uiCallback); EnqueuePriorityRequest(gpxRequest); } catch (Exception e) { e.printStackTrace(); throw new CWException(e.toString()); } }
/** * Posts an asynchronous LogPosition Request * * @param username * @param password * @param location * @throws CWException */ public void PostCurrentPositionRequest( String username, String password, LocationIdentifier location) throws CWException { LogPositionRequest request; try { request = new LogPositionRequest( username, HashUtils.HashPassword(password), 0, "AndroidTracker", location); EnqueueRequest(request); } catch (Exception e) { e.printStackTrace(); throw new CWException(e.toString()); } }