public static void main(String[] args) {

		Image image = readImageData("joker.jpg");
		if (image == null || image.getData() == null) {
			System.err.println("Given image could not be read");
			return;
		}
		try {

			// initialize proxy class (this perform authorisation)
			ITraffSoapProxy iTraffSoap = new ITraffSoapProxy(clientId, clapiKey, apiKey);
			
			// insert new image with 123# as ID and "Image name" as the name
			// (examplary response: {status=0})
			Map<String, Object> result2 = iTraffSoap.imageInsert("123#", "Image name", Base64.encodeBase64String(image.getData()));

			// apply changes (this needs to be invoked before the newly added
			// (examplary response: {status=0})
			// picture can be recognizable)
			// result2 = iTraffSoap.indexBuild();

			// check progress of applying the changes (examplary response:
			// {status=0, data={progress=100, status=ok, uploading=0,
			// needUpdate=0}})
			Map<String, Object> result = iTraffSoap.indexStatus();
			System.out.println(result.toString());

			// recognize image (this returns all the results from the
			// recognition)
			APIResponse response = recognizeReturnAll(image);
																// recognized
																// images
			System.out.println(response.toString());

			// recognize image (this returns only the best result from the
			// recognition)
			response = recognizeReturnBest(image);
			System.out.println(response.toString());
			image.draw(response).save("frames.jpg");
			
			// recognize image (in multiple mode). Remember to change the mode at recognize.im first.
			response = recognizeMulti(image);
			System.out.println(response.toString());
			
			// recognize image (in multiple mode). Remember to change the mode at recognize.im first.
			response = recognizeMultiAllInstances(image);
			System.out.println(response.toString());

		} catch (RemoteException e) {
			System.out.println(e.toString());
			// TODO handle the case when there was a proble with accessing the
			// remote SAOP service
		} catch (JSONException e) {
			// TODO handle the case when the response from the server was not in
			// the JSON format
		} catch (IOException e) {
			// TODO handle the case when there wa IO problem with sending the
			// request or receiving the response
		}

	}