API java client implementation problem

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

API java client implementation problem

Viktor Stroh
Dear users, maybe one of you could help me with the implementation of
the api java client.
I tried to execute the following lines of code as described in the
documentation
(https://geonetwork-opensource.org/manuals/trunk/en/api/the-geonetwork-api.html#building-client-for-the-api-using-codegen):

"...
     private static final String CATALOGUE_URL =
"http://127.0.0.1:8080/geonetwork";
     ApiClient client;
     private static final String USERNAME = "***";
     private static final String PASSWORD = "***";

     public void initConfiguration() {
         client
             = Configuration.getDefaultApiClient();
         client.setBasePath(CATALOGUE_URL);
     }

     public void getMeInfoTest() {
         try {
             client.getHttpClient().networkInterceptors().clear();
             if (client.getHttpClient().getFollowRedirects())
                 System.out.println("FollowRedirects");

             MeApi meApi = new MeApi();
             MeResponse meResponse = meApi.getMe();

         } catch (ApiException e) {
             e.printStackTrace();
         }
     }
..."

After the call "MeResponse meResponse = meApi.getMe();"
comes the exception "org.fao.geonet.ApiException: Content type
"text/html;charset=utf-8" is not supported for type: class
org.fao.geonet.openapi.model.MeResponse"

What could be wrong?



_______________________________________________
GeoNetwork-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork