class DMZSyncServiceImpl extends RemoteServiceServlet implements
		DMZSyncService {

	@Override
	public String sendSync(String locale) throws DMZSyncException{
	//send json
		String json = getSyncJsonData(locale);
		System.out.println("getSyncJsonData################################# "+json);
		String url = getHostAddress() + "/OsceSync/syncJson";
		//Send OSCE data to DMZ and return DMZ data
		//dmz json
		
		//System.out.println(">>>>>>>> return json: "+returnJson);
		String message = "";
		if(!json.equals("")){	
			String returnJson = sendData(json,url);
			try{
				JSONObject myjson = new JSONObject(returnJson);
				message = getReturnMessage(myjson);
			}catch(JSONException e){
				
				Log.error(e.getMessage());
				e.printStackTrace();
				
				throw new DMZSyncException(DMZSyncExceptionType.HTTP_EXCEPTION,e.getMessage());
				
			}catch(Exception e){
				
				Log.error(e.getMessage());
				e.printStackTrace();
				
				throw new DMZSyncException(DMZSyncExceptionType.HTTP_EXCEPTION,e.getMessage());
				
			}
			
		}
		return message;
	}

}