Connecting Java Web App inside SAP HCP to SuccessFactor Odata service using restlet

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Connecting Java Web App inside SAP HCP to SuccessFactor Odata service using restlet

atingson
This post has NOT been accepted by the mailing list yet.
I am having trouble using restlet on SAP HCP.

I did this:

http://weblogs.asp.net/uruit/accessing-odata-from-android-using-restlet

I was able to generate the POJO and service class from Success Factor Odata API

The app is working well on local. However when I deploy in HCP, it results to this error:


Error while retrieving tenant datacom.sap.core.tenant.common.TenantAdministrationException: Error retrieving tenant information from system database. Port: [20002]. Configuration path: [default]
        at com.sap.core.tenant.registry.runtime.util.NonOSGiSystemDBHelper.getTenantDataModelFromDB(NonOSGiSystemDBHelper.java:67)
        at com.sap.core.tenant.registry.runtime.util.AbstractDBHelper.getTenantDataWithReplacedAccountIfNeeded(AbstractDBHelper.java:24)
....

Caused by: java.io.IOException: Server returned HTTP response code: 401 for URL: http://localhost:20002/config/v1/services/tenant/default
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1612)
        at com.sap.core.tenant.registry.runtime.util.NonOSGiSystemDBHelper.readPropertiesFromResponse(NonOSGiSystemDBHelper.java:80)

I am aware that in SAP HCP, HttpClient should be access throught HttpDestination, which in turn can be accessed through JNDI.

https://help.hana.ondemand.com/help/frameset.htm?e592cf6cbb57101495d3c28507d20f1b.html


Where is the part in Restlet Client that creates HttpClient connection. Can I override it so that I can do it this way:

//create http client. HttpDestination is SAP Proprietary interface
HttpClient httpClient = destination.createHttpClient();



StackOverflow post:

http://stackoverflow.com/questions/29069534/connecting-java-web-app-inside-sap-hcp-to-successfactor-odata-service-using-rest
Loading...