0

I am trying to use Apache Wink to get Service Document from an IBM host but I always get error 403 Forbidden. Here is my code :

import org.apache.wink.client.Resource;
import org.apache.wink.client.RestClient;

public class CommunityEvents {
    private String uri = "https://w3-connections.ibm.com/profiles/atom/search.do?name=Nam,+Vu+Hoai";

    public CommunityEvents() {
         RestClient restClient = new RestClient();
         Resource resource = restClient.resource(uri);
         System.out.println(resource.get().getMessage());
    }

    public static void main(String[] args) {
         new CommunityEvents();
    }
}

The link is working fine when I put it into browser address. I have tried with other https and they worked.

Can someone correct my code or tell me what I missed ? what I need to do to access the link above ?

Thank you so much !

1 Answers1

0

is the URL trusted by your JVM? I imagine it's a CACERTS issue. You'll want to extract the certificate using your browser, and use the keytool to import it into your JVM CACERTS.

Also Wink supports JSON and other resource styles, make sure you have the right library for ATOM+XML which is the current resource URL you selected.

Paul Bastide
  • 1,505
  • 4
  • 17
  • 22