@j2147120 wrote:
Hello,
I trying to use Kaltura Api Client for Java, but I have some problem with urls. I want to retrieve media info.
Java Client generates "http://dev1/api_v3/service/media/action/get" url and fails because Kaltura returns 301 Moved permamently status and redirects to "http://dev1/api_v3/index.php/service/media/action/get" url.What can be cause of this issue ?
KalturaConfiguration config = new KalturaConfiguration(); config.setEndpoint("http://dev1"); KalturaClient client = new KalturaClient(config); String sessionId = client.generateSessionV2("666666666666666666666", "test@test.com", KalturaSessionType.ADMIN, 666, 38400, ""); client.setSessionId(sessionId); client.getMediaService().get("");
Java exception:
[Fatal Error] :1:50: White spaces are required between publicId and systemId. Exception in thread "main" com.kaltura.client.KalturaApiException: Failed while parsing response. at com.kaltura.client.utils.XmlUtils.parseXml(XmlUtils.java:70) at com.kaltura.client.KalturaClientBase.doQueue(KalturaClientBase.java:279) at com.kaltura.client.services.KalturaMediaService.get(KalturaMediaService.java:219) at com.kaltura.client.services.KalturaMediaService.get(KalturaMediaService.java:208) at asdasd.kaltura_tests.AppOldApi.main(AppOldApi.java:19)
Response returned by Kaltura:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>301 Moved Permanently</title> </head><body> <h1>Moved Permanently</h1> <p>The document has moved <a href="http://dev1/api_v3/index.php/service/media/action/get">here</a>.</p> <hr> <address>Apache/2.2.15 (CentOS) Server at 123.123.123.213 Port 80</address> </body></html>
Regards
Posts: 3
Participants: 2