Issue with Server Integration using PHP. Says "bad-response"

Avatar

Avatar

TK_Radion

Avatar

TK_Radion

TK_Radion

25-10-2011

Hi,

Using PHP 5.2.5 and LCCS.php revision #2 for server integration.

Have followed code from sample application, but it gives error when trying to initiate object for RTCAccount.

This is what I get when trying with Command Prompt:

C:\wamp\bin\php\php5.2.5>php C:\wamp\www\radion_php\lccs\lccs.php --debug --host=http://collaboration.adobelivecycle.com cprovider USER_NAME PASSWORD

$Revision: #2 $ - $Date: 2011/07/20 $

http_get: http://collaboration.adobelivecycle.com/cprovider?mode=xml&accountonly

=true&

Array

(

    [0] => HTTP/1.1 302 Moved Temporarily

    [1] => Server: Apache-Coyote/1.1

    [2] => X-Powered-By: Servlet 2.4; JBoss-4.2.1.GA (build: SVNTag=JBoss_4_2_1_

GA date=200707131605)/Tomcat-5.5

    [3] => Expires: Tue, 25 Oct 2011 09:29:17 GMT

    [4] => Cache-Control: max-age=30

    [5] => Set-Cookie: Whitcomb-Ident=cprovider:na2-sdk-a757f7e0-6ecf-450a-8959-

3c08b63fdb84; Domain=collaboration.adobelivecycle.com; Path=/cprovider

    [6] => Location: https://na2.collaboration.adobelivecycle.com/cprovider?mode

=xml&accountonly=true&

    [7] => Content-Language: en-US

    [8] => Content-Length: 0

    [9] => Date: Tue, 25 Oct 2011 09:28:47 GMT

    [10] => Connection: close

)

Error: exception 'RTCError' with message 'bad-response' in C:\wamp\www\radion_php\lccs\lccs.php:674

Stack trace:

#0 C:\wamp\www\radion_php\lccs\lccs.php(255): RTCAccount->do_initialize()

#1 C:\wamp\www\radion_php\lccs\lccs.php(1047): RTCAccount->__construct('http://collabor...')

#2 {main}

C:\wamp\bin\php\php5.2.5>

Not sure if I am missing something.

Please help..

Thanks

Accepted Solutions (0)

Answers (5)

Answers (5)

Avatar

Avatar

nzezelj

Avatar

nzezelj

nzezelj

01-11-2011

To add to my post above, I'd curious to know what fixed it for you (out of those 3 things you've tried).

Nikola

Avatar

Avatar

nzezelj

Avatar

nzezelj

nzezelj

01-11-2011

Hi,

Please notice that this time you've 'failed' very differently than before.  The debug log you supplied above does the redirect and retrieves plenty of information from the LCCS service. 

For example:

==== room list for cprovider ====

http_get: https://na2.collaboration.adobelivecycle.com:443/app/content/accounts/

jia/na2-sdk-a757f7e0-6ecf-450a-8959-3c08b63fdb84/meetings/?gak=cmVuZ2E qbmExcioxM

zM1ZWVlODNjOSpYMzg4TUJTVDc1N1EzMU5TSFRNNldEQzBXNA==

myfirstroom::Wed, 14 Sep 11 07:03:11 -0400

chatroom::Wed, 14 Sep 11 07:03:28 -0400

lccschatroom:myApp:Wed, 14 Sep 11 07:20:32 -0400

dfphchatroom:myApp:Wed, 12 Oct 11 02:59:38 -0400

iproviderchatroom:myApp:Wed, 12 Oct 11 03:49:15 -0400

It fails on "archive list retrieval', but that is a known issue if you do not have any recordings.  So, in fact, it works!

Feel free to use any other server-to-server commands and re-verify, but I do not think you should have any problems.

Thanks,

Nikola

Avatar

Avatar

TK_Radion

Avatar

TK_Radion

TK_Radion

01-11-2011

Hi,

Thank you for responses. But that didn't work for me.

-- I tried with new version PHP (revision #11)

-- I used 'follow_location' in PHP.

-- I used Curl extesion.

Nothing works as expected. Always getting that Bad-Response.

This is what I am getting with Curl

C:\Documents and Settings\user>C:\wamp\bin\php\php5.2.5\php C:\wamp\www\radion_p

hp\lccs\lccs.php --debug --host=http://collaboration.adobelivecycle.com cprovide

r USER_NAME PASSWORD

$Revision: #11 $ - $Date: 2011/07/27 $

http_get: http://collaboration.adobelivecycle.com/cprovider?mode=xml&accountonly

=true&

<result code="unauthorized">

<baseURL href="https://na2.collaboration.adobelivecycle.com:443/"/>

<authentication href="https://na1r.services.adobe.com/account/wsapi/auth/v1"/>

</result>

http_post: https://na1r.services.adobe.com/account/wsapi/auth/v1 <request><usern

ame>USER_NAME</username><password>PASSWORD</password></request>

Array

(

    [Content-Type] => text/xml

)

<response status="ok">

        <authtoken type="SSO_ADOBE">renga*na1r*1335eee83c9*X388MBST757Q31NSHTM6W

DC0W4</authtoken>

</response>

Array

(

)

http_get: https://na2.collaboration.adobelivecycle.com:443/cprovider?mode=xml&ac

countonly=true&gak=cmVuZ2EqbmExcioxMzM1ZWVlODNjOSpYMzg4TUJTVDc1N1EzMU5TSFRNNldEQ

zBXNA==

<meeting-info>

        <baseURL href="https://na2.collaboration.adobelivecycle.com:443/"/>

        <accountPath href="https://forums.adobe.com/accounts/jia/na2-sdk-a757f7e0-6ecf-450a-8959-3c08b63

fdb84"/>

        <room instance="na2-sdk-a757f7e0-6ecf-450a-8959-3c08b63fdb84/#room#"/>

        <fmsURL href="https://forums.adobe.com/fms?ticket=#ticket#"/>

        <ticketURL href="https://forums.adobe.com/app/ticket"/>

</meeting-info>

==== template list for cprovider ====

http_get: https://na2.collaboration.adobelivecycle.com:443/app/content/accounts/

jia/na2-sdk-a757f7e0-6ecf-450a-8959-3c08b63fdb84/templates/?gak=cmVuZ2EqbmExciox

MzM1ZWVlODNjOSpYMzg4TUJTVDc1N1EzMU5TSFRNNldEQzBXNA==

myApp:Wed, 14 Sep 11 07:20:19 -0400

aaa:Wed, 12 Oct 11 02:19:17 -0400

==== room list for cprovider ====

http_get: https://na2.collaboration.adobelivecycle.com:443/app/content/accounts/

jia/na2-sdk-a757f7e0-6ecf-450a-8959-3c08b63fdb84/meetings/?gak=cmVuZ2EqbmExcioxM

zM1ZWVlODNjOSpYMzg4TUJTVDc1N1EzMU5TSFRNNldEQzBXNA==

myfirstroom::Wed, 14 Sep 11 07:03:11 -0400

chatroom::Wed, 14 Sep 11 07:03:28 -0400

lccschatroom:myApp:Wed, 14 Sep 11 07:20:32 -0400

dfphchatroom:myApp:Wed, 12 Oct 11 02:59:38 -0400

iproviderchatroom:myApp:Wed, 12 Oct 11 03:49:15 -0400

==== archive list for cprovider ====

http_get: https://na2.collaboration.adobelivecycle.com:443/app/content/accounts/

jia/na2-sdk-a757f7e0-6ecf-450a-8959-3c08b63fdb84/archives/?gak=cmVuZ2EqbmExcioxM

zM1ZWVlODNjOSpYMzg4TUJTVDc1N1EzMU5TSFRNNldEQzBXNA==

Error: exception 'RTCError' with message 'bad-response' in C:\wamp\www\radion_ph

p\lccs\lccs.php:309

Stack trace:

#0 C:\wamp\www\radion_php\lccs\lccs.php(362): RTCAccount->listItems('archives')

#1 C:\wamp\www\radion_php\lccs\lccs.php(1064): RTCAccount->listArchives()

#2 {main}

Though I am not sure if I would be able to use Curl on Live web server.

Please suggest.

Thanks.

Avatar

Avatar

Raff_

Employee

Avatar

Raff_

Employee

Raff_
Employee

25-10-2011

Looks like for some reason your version of PHP is not following redirects. When it works your initial response should look like this:

http_get: http://collaboration.adobelivecycle.com/rsdk?mode=xml&accountonly=true&

Array

(

    [0] => HTTP/1.1 302 Moved Temporarily

    [1] => Server: Apache-Coyote/1.1

    [2] => X-Powered-By: Servlet 2.4; JBoss-4.2.1.GA (build: SVNTag=JBoss_4_2_1_GA date=200707131605)/Tomcat-5.5

    [3] => Expires: Tue, 25 Oct 2011 22:48:18 GMT

    [4] => Cache-Control: max-age=30

    [5] => Set-Cookie: Whitcomb-Ident=rsdk:na2-61bc24ff-e1f4-488f-b0a6-70f9a8e48962; Domain=collaboration.adobelivecycle.com; Path=/rsdk

    [6] => Location: https://na2.collaboration.adobelivecycle.com/rsdk?mode=xml&accountonly=true&

    [7] => Content-Language: en-US

    [8] => Content-Length: 0

    [9] => Date: Tue, 25 Oct 2011 22:47:48 GMT

    [10] => Connection: close

    [11] => HTTP/1.1 200 OK

    [12] => Server: Apache-Coyote/1.1

    [13] => Set-Cookie: JSESSIONID=gCk22N5MfCrGiXtGizAa.27; Path=/

    [14] => Cache-Control: max-age=0

    [15] => Content-Type: text/xml;charset=UTF-8

    [16] => Content-Length: 190

    [17] => Date: Tue, 25 Oct 2011 22:47:49 GMT

    [18] => Connection: close

)

Your version stops at 10 entries, the first response, that is a redirect. A working one has an extra set of entries for a second response, that is after following the redirect.

I have no clues of why this wouldn't work since by default redirects are enabled. You could try to add this extra option (from here: http://php.net/manual/en/context.http.php) at around line 681:

'follow_location' => true

Like this:

            $opts = array (

                'http' => array (

                    'method' => 'GET',

                    'header' => $header,

           'follow_location' => true

                )

            );

Or you can try to use CURL if your version of PHP supports it, buy changing $USE_CURL to true (line 629) :

    public static $USE_CURL = false;



Avatar

Avatar

nzezelj

Avatar

nzezelj

nzezelj

25-10-2011

Hi Tilak,

Ensure you are using the latest LCCS.php file.  There was a recent thread on it (http://forums.adobe.com/message/3975633#3975633), to which I attached the latest revision file.

Other than that, I am not sure why your code throws the RTC.  I just tried it and it worked for me with PHP 5.3.8.

Try with the latest LCCS.php and let us know how it goes.

Thanks,

Nikola