HttpPost httpPost = new HttpPost("http://www.inspire-geoportal.eu/INSPIREValidatorService/resources/validation/inspire"); //xml response: httpPost.addHeader("Accept", "application/xml"); //html response httpPost.addHeader("Accept", "text/html"); FileBody dataFile = new FileBody(new File("yourMetadataFile.xml")); MultipartEntity reqEntity = new MultipartEntity(); reqEntity.addPart("dataFile", dataFile); httpPost.setEntity(reqEntity); HttpResponse response = httpclient.execute(httpPost); int statusCode = response.getStatusLine().getStatusCode(); switch (statusCode) { //OK case 200: //implement the below method to extract the response parseServiceResponse(response); break; //Exception was thrown case 400: //implement the below method to handle the exceptions handleServiceException(response); break; //Internal error from the service default: //implement the below method to handle errors such as internal server error handleServerError(response); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)