I am trying to write a java client for Restful web service implemented using WCF & NTLM Authentication.
I am able to use Apache HTTPClient library to connect and retrieve the data.
The following code gives me the response in the JSon text form.
DefaultHttpClient httpClient = new DefaultHttpClient();
httpClient.getCredentialsProvider().setCredentials(new AuthScope(hostName, 443), new NTCredentials(userName, password, hostName, domainName));
httpclient.getAuthSchemes().register("ntlm", new NTLMSchemeFactory());
HttpConnectionParams.setConnectionTimeout(httpclient.getParams(), 150000);
HttpGet httpget = new HttpGet(url);
httpget.setHeader("Content-Type", "application/json");
HttpResponse response = httpclient.execute(httpget);
HttpEntity responseEntity = response.getEntity();
content = EntityUtils.toString(responseEntity);
Now i am writing JSon parser to convert the JSon text into business objects(Manually created classes).
Does anyone knows how to automate the business object class creation and automated response parser to convert Json text to java object as we consume SOAP based Web Services using frameworks like Axis/CXF?