1
votes

first of all I have the following components:

  • SharePoint 2010 Server (intranet -> accessable only by valid domain account)
  • SharePoint Lists I need to read
  • Java Client Application consuming SharePoint REST service (not working!)

I've searched for a while now and I can't find a working java version to consume a REST service from a SharePoint 2010 server with domain authentication. I already tried Spring Framework for this issue which does not really help.

I changed the example code (from https://spring.io/guides/gs/consuming-rest/) to following and it works fine:

RestTemplate restTemplate = new RestTemplate();
String s = restTemplate.getForObject("http://gturnquist-quoters.cfapps.io/api/random", String.class);
System.out.println(s);

But my URL looks completely different: "http://server/site/_vti_bin/listdata.svc/listName"

When I try to make the same call with my URL I get the error message: org.springframework.web.client.HttpClientErrorException: 400 Bad Request

So my first problem is to make the Spring Framework work with the SharePoint REST service. Since I also tried plain Http-calls I assume that I will get an authentication problem in the next step since the SharePoint server is only accessable by people authenticated by the active directory (with valid kerberos ticket).

Can anyone help me to get this SharePoint REST <-> Java communication to work ?

1
This is old but maybe chrisweldon.net/sharepoint/… helps.Marcel Stör

1 Answers

0
votes

You can take a look of this project I've created that communicates with the sharepoint rest API and has a working implementation of most common operations you'll need. Also you can extend it with your needs as you'll have a working code example

https://github.com/kikovalle/PLGSharepointRestAPI-java