I do not have direct access to my SharePoint server. I access the SharePoint data from a URL that is available only internal on my work VPN.

Is there a way in JAVA to query this URL and return data from it?

Edit - I found this syntax that returns a 200 OK like you suggested, but how do I now take it a step further to return specific data from a list

public class SharePointClientAuthentication {

public static void main(String[] args) throws Exception {
CredentialsProvider credsProvider = new BasicCredentialsProvider();
        new AuthScope(AuthScope.ANY),
        new NTCredentials("username", "password", "https://hostname", "domain"));
CloseableHttpClient httpclient = HttpClients.custom()
try {
    HttpGet httpget = new HttpGet("http://hostname/_api/web/lists");

    System.out.println("Executing request " + httpget.getRequestLine());
    CloseableHttpResponse response = httpclient.execute(httpget);
    try {
    } finally {
} finally {

1 Answer 1


The easiest way? Look at the SharePoint Online REST Services, here is a brief intro:


If you have access to at least the Public SharePoint server by REST Call this can do it for you. Let me know if that helps or if this needs more clarity, thanks!


Java Has API's out there to make REST web service calls, not sure what they are exactly as my Java isn't the best, but it can be done.

  • Do I need the SP wsdl files to use the REST call you link to above? Commented Dec 27, 2018 at 18:14
  • Nope, no WSDL Required for REST calls, just shape your URL for your call into what you want to do.
    – tekiegreg
    Commented Dec 27, 2018 at 18:15
  • 1
    Excellent, I'll give this a whirl and see what I can come up with. Thank you! Commented Dec 27, 2018 at 18:16
  • 1
    Is there a full syntax example that shows how to connect with JAVA that you know? Commented Dec 27, 2018 at 18:47
  • Not offhand but I'm sure some Googling would yield something. My best suggestion for you is since REST works via simple browser calls, construct your REST URL to call SharePoint in Chrome and see the result in XML or JSON returned, continue to refine until you can build a Java Call that calls that URL and returns the result. Also recommended for beginners to REST, download a copy of SoapUI, it can help construct REST and SOAP/WSDL calls as well.
    – tekiegreg
    Commented Dec 27, 2018 at 19:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.