Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
1 reply Latest Post - ‏2012-04-10T18:09:56Z by BirajSaha
mgibson
mgibson
1 Post
ACCEPTED ANSWER

Pinned topic Cognos Mashup Service Authentication Issues / Advice

‏2012-04-03T03:56:12Z |
Hi, I realise this is a question specific to the Cognos Mashup Service, but there is very little activity on that forum, and I thought people on this forum may be able to help - I thought it was worth a try in any case - but I understand if you cannot assist. But here goes...

We are attempting to utilise the Cognos Mashup Service SOAP API within a PHP page to return objects from a Report Studio report (eg. a Table or Chart object), but are experiencing difficulty and are looking for advice.

We are attempting to do this with Cognos version 10.1.1 installed on Linux.

In our implementation, the SOAP client seems to fail to authenticate as it always return “missingValue” on username and password.

It also generates unknown errors when trying to retrieve the report information – typing the REST URL in browser works fine on the other hand, eg.

http://www.mydomain.com/cognos/cgi-bin/cognos.cgi/rds/pagedReportData/report/i74604A90FF184231894B509C2D9AC9EA

We’re wondering if we did something wrong in the code here and looking for advice on how to progress with this issue?

The code is as follow:



// Get Authenticated $authUrl   = 
"http://www.mydomain.com/cognos/cgi-bin/cognos.cgi/rds/auth/wsdl"; $auth            = array( 
'credentials' => array( 
'credentialElements' => array( 
'name'      => 
'CAMNamespace', 
'value'     => array(
'actualValue' => $nspace), ), 
'credentialElements' => array( 
'name'      => 
'CAMUsername', 
'value'     => array(
'actualValue' => $user), ), 
'credentialElements' => array( 
'name'      => 
'CAMPassword', 
'value'     => array(
'actualValue' => $pass), ), ) ); $authclient      = 

new SoapClient($authUrl); $access          = $authclient->logon($auth); echo 
'<pre>'; var_dump($access); echo 
'</pre>'; 
// Get Report $soapUrl   = 
"http://www.mydomain.com/cognos/cgi-bin/cognos.cgi/rds/wsdl"; $param           = array( 
'sourceID'        => 
'i74604A90FF184231894B509C2D9AC9EA', 
'sourceType'      => 
'report', ); $client          = 

new SoapClient($soapUrl); $result          = $client->GetReportData($param); echo 
'<pre>'; var_dump($result); echo 
'</pre>';

Results:


object(stdClass)#2 (2) 
{ [
"responseCode"]=> string(8) 
"NO_ERROR" [
"result"]=> object(stdClass)#3 (1) 
{ [
"credentialPrompt"]=> object(stdClass)#4 (1) 
{ [
"credentialElements"]=> array(4) 
{ [0]=> object(stdClass)#5 (2) 
{ [
"name"]=> string(12) 
"CAMNamespace" [
"value"]=> object(stdClass)#6 (1) 
{ [
"actualValue"]=> string(2) 
"DU" 
} 
} [1]=> object(stdClass)#7 (3) 
{ [
"name"]=> string(23) 
"CAMNamespaceDisplayName" [
"label"]=> string(10) 
"Namespace:" [
"value"]=> object(stdClass)#8 (1) 
{ [
"actualValue"]=> string(21) 
"Active Directory - DU" 
} 
} [2]=> object(stdClass)#9 (3) 
{ [
"name"]=> string(11) 
"CAMUsername" [
"label"]=> string(8) 
"User ID:" [
"value"]=> object(stdClass)#10 (1) 
{ [
"missingValue"]=> object(stdClass)#11 (1) 
{ [
"valueType"]=> string(4) 
"text" 
} 
} 
} [3]=> object(stdClass)#12 (3) 
{ [
"name"]=> string(11) 
"CAMPassword" [
"label"]=> string(9) 
"Password:" [
"value"]=> object(stdClass)#13 (1) 
{ [
"missingValue"]=> object(stdClass)#14 (1) 
{ [
"valueType"]=> string(10) 
"textnoecho" 
} 
} 
} 
} 
} 
} 
} Fatal error: Uncaught SoapFault exception: [Server] The server did something wrong in /var/www/html/cognos/soap.php:45 Stack trace: #0 /var/www/html/cognos/soap.php(45): SoapClient->__call(
'GetReportData', Array) #1 /var/www/html/cognos/soap.php(45): SoapClient->GetReportData(Array) #2 
{main
} thrown in /var/www/html/cognos/soap.php on line 45

Any advice?
Updated on 2012-04-10T18:09:56Z at 2012-04-10T18:09:56Z by BirajSaha
  • BirajSaha
    BirajSaha
    1 Post
    ACCEPTED ANSWER

    Re: Cognos Mashup Service Authentication Issues / Advice

    ‏2012-04-10T18:09:56Z  in response to mgibson
    Hi there,

    Apologies for the recent lack of activity on the other "Cognos SDK and Diagnostic Tools" forum (https://www.ibm.com/developerworks/forums/forum.jspa?forumID=1576&start=0), I am now "watching" that forum.

    I have posted te following reply to that forum: https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14811114&#14811114

    Please check there for further details.