class DMZSyncServiceImpl extends RemoteServiceServlet implements
		DMZSyncService {

	protected String sendData(String json,String url) throws DMZSyncException {

		HttpClient httpClient = new HttpClient();
		String ret = "";	
	    
		PostMethod postMethod = new PostMethod(url);

		NameValuePair[] registerInform = new NameValuePair[1];
		registerInform[0] = new NameValuePair("data", json);

		postMethod.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8");
		postMethod.setRequestBody(registerInform);
		
		authenticate(httpClient, postMethod);

		int statusCode = 0;
		try {
			statusCode = httpClient.executeMethod(postMethod);
			
				ret = postMethod.getResponseBodyAsString();
				
				
		} catch (HttpException e) {
			throw new DMZSyncException(DMZSyncExceptionType.HTTP_EXCEPTION,url+": "+e.getMessage());
		} catch (IOException e1) {
			throw new DMZSyncException(DMZSyncExceptionType.CONNECT_HOST_ADDRESS_EXCEPTION,url+": "+e1.getMessage());
		}
		if(ret.equals("Data Error")){
			throw new DMZSyncException(DMZSyncExceptionType.RUN_TIME_EXCEPTION,": "+ret);
		}

		if (!(statusCode == HttpStatus.SC_MOVED_PERMANENTLY || statusCode == HttpStatus.SC_MOVED_TEMPORARILY)) {
			System.err.println("field.");
		}
		
		return ret;
	}

}