Error 2032 trying to login using client api

3 replies [Last post]
Joined: 12/15/2009
Points: 27

I'm using the actionscript API to login but when I do it I always get an error:
"Error #2032: Stream Error. URL: http://174.143.151.19/kalturaCE/restserver.php?service=session&action=start"

Here is how I do it:

var startSess:SessionStart = new SessionStart("5ad434bdecd5a936eb328ccf70e85f78","1",0,1);
               var c :KalturaConfig = new KalturaConfig();
               c.domain="http://174.143.151.19/kalturaCE";
               c.partnerId="1";
               c.ks="7eddbf13c5235a839b0c7e7cbb21f6fe";
               
               addEventListener(KalturaEvent.COMPLETE,loggedIn);
               addEventListener(KalturaEvent.FAILED,loggedIn);
               startSess.config = c;
               startSess.execute();

Also as a side question my handler for KalturaEvent.FAILED never gets called even though I know it's failing (from the Debugger) ... I'm new to actionscript -- am I setting up the handlers properly?

Thanks!

Joined: 12/15/2009
Points: 27

I think this just a flat out bug ... there is no restserver.php anywhere to be found..! probably a leftover/byproduct from the hosted version they have. This doesn't work if you use your own hosting.

A workaround I did: just used the php client libs to make the calls then just loaded the php file from the web.

Joined: 01/05/2009
Points: 1697

Hi, this is not a bug, but a simple miss-use of the client. the way it should be done is as follow:

private function createSession() : void
{
        var configuration : KalturaConfig = new KalturaConfig();
        configuration.partnerId = "your partner id here";
        configuration.domain = "http://www.kaltura.com"; //or your other CE domain
        configuration.srvUrl = "api_v3/index.php"; //or whatever you changed the api_v3 root to (this the default)
        _kc = new KalturaClient( configuration );
        //choose either admin or user, the last attr determines the session timeout
        var startSession : SessionStart = new SessionStart( "your secret goes here" ,"your user id here" ,KalturaSessionType.ADMIN , 32971);
        startSession.addEventListener( KalturaEvent.COMPLETE , onSessionStart );
        startSession.addEventListener( KalturaEvent.FAILED , onFailed );
        _kc.post( startSession );
}

private function onSessionStart( event : KalturaEvent ) : void
{
        //do something here...
}

private function onFailed( event : KalturaEvent ) : void
{
        //do something here...
}

Joined: 12/15/2009
Points: 27

Okay -- the part I was missing was that "restserver.php" should be api_v3/index.php
it works now.