Exception in oslcClient.lookupServiceProviderUrl [message #1444058] |
Mon, 13 October 2014 15:26 |
Jan-Patrick Osterloh Messages: 6 Registered: September 2014 |
Junior Member |
|
|
Dear all,
I used the GeneratorModel approach to create the Service Provider Catalog, the Services etc for my own Service. Now I'm writing the Client side, and I decided to use the OsclClient from org.eclipse.lyo.client.java, staring from the GenericCMSample:
String catalogUrl = "...";
String providerTitle = "...";
//STEP 1: Create a new generic OslcClient
OslcClient client = new OslcClient();
//STEP 2: Find the OSLC Service Provider
String serviceProviderUrl = client.lookupServiceProviderUrl(catalogUrl, providerTitle);
When I paste the catalogUrl into my browser, I can see the generated html for my catalog, and everything seem to work. However, when I start the code above, I get a ResourceNotFoundException (org.eclipse.lyo.client.exception.ResourceNotFoundException: OSLCC004: The requested resource could not be found).
With some debugging, I found that the getServiceProviderCatalog() of the generated ServiceProviderCatalogService is called, and returns the correct ServiceProviderCatalog. But when the getResource() Method in the OsclClient returns in the lookupServiceProviderUrl(), the ClientResponse shows an Error 400 Bad Request, and the catalog is null in this code:
public String lookupServiceProviderUrl(final String catalogUrl, final String serviceProviderTitle) throws IOException, OAuthException, URISyntaxException, ResourceNotFoundException
{
String retval = null;
ClientResponse response = getResource(catalogUrl, OSLCConstants.CT_RDF);
System.out.println("RESP: " + response.getStatusCode() + " " + response.getMessage());
ServiceProviderCatalog catalog = response.getEntity(ServiceProviderCatalog.class);
...
This results in the following output:
RESP: 400 Bad Request
org.eclipse.lyo.client.exception.ResourceNotFoundException: OSLCC004: The requested resource could not be found. Resource: .../services/catalog/1 Value: WCET.
at org.eclipse.lyo.client.oslc.OslcClient.lookupServiceProviderUrl(OslcClient.java:395)
Any Idea what this could be, or how to fix that? Any help is appreciated.
Best regards
Jan-Patrick
|
|
|
|
Powered by
FUDForum. Page generated in 0.03256 seconds