Author Topic: Allow SDK connections to Cognos  (Read 1566 times)

Offline psenechal

  • Associate
  • **
  • Posts: 2
  • Forum Citizenship: +0/-0
Allow SDK connections to Cognos
« on: 01 Dec 2009 04:22:53 pm »
I have the SDK installed and I ran a very simple C# app to login to Cognos and retrieve the CAM Passport. I'm getting the following error:

CM-REQ-4342 An error occurred with the client.

I'm pretty sure it's because my Cognos Configuration file has not been setup to allow remote connections. We're running Cognos on Unix which just isn't my specialty, but I'm thinking some of these options need to be enabled...I just don't know which ones:

Code: [Select]
              <crn:instances name="DS_NET_CONNECTION" disabled="true">
                <!-- localhost: Defines a group of properties used to define a server connection.  -->
                <!-- Ensure that the server exists and that the resource name is the host name of the
                     remote server.  -->
                <crn:instance name="localhost" class="DS_NET_SERVERCONNECTION" disabled="true">
                  <!-- DS_NET_PORT: Specifies the port of the remote connection.  -->
                  <crn:parameter name="DS_NET_PORT" disabled="true">
                    <crn:value xsi:type="xsd:unsignedShort">9300</crn:value>
                  </crn:parameter>
                  <!-- DS_NET_PROTOCOL: The protocol used for remote connection.  -->
                  <!-- Use this property to specify the protocol for the remote connection.  -->
                  <crn:parameter name="DS_NET_PROTOCOL" disabled="true">
                    <crn:value xsi:type="xsd:string">SOAP</crn:value>
                  </crn:parameter>
                  <!-- DS_NET_PWD: The service access password for the Data Manager network server.  -->
                  <crn:parameter name="DS_NET_PWD" disabled="true">
                    <crn:value xsi:type="cfg:systemPassword">NoPassWordSet</crn:value>
                  </crn:parameter>
                </crn:instance>
              </crn:instances>

Do I just need to change the flag to FALSE on the disabled tags in DS_NET_CONNECTION, DS_NET_SERVERCONNECTION, and DS_NET_PORT?

Also...it looks like we haven't defined a namespace...

Code: [Select]
      <crn:parameter name="cps_namespaceID">
        <crn:value xsi:type="xsd:string"></crn:value>
      </crn:parameter>

are we required to have one in order to connect using the SDK?

The method I'm using to connect is...

Code: [Select]
        contentManagerService1 cm = new contentManagerService1();
        cm.Url = "http://bi-olap.vsp.com:9300/p2pd/servlet/dispatch";

        string defaultUserName = "username";
        string defaultPassword = "password";
        string defaultNamespace = null;
        string cam_passsport = null;

        try
        {
            System.Text.StringBuilder credentialXML = new System.Text.StringBuilder("<credential>");
            credentialXML.AppendFormat("<namespace>{0}</namespace>", defaultNamespace);
            credentialXML.AppendFormat("<username>{0}</username>", defaultUserName);
            credentialXML.AppendFormat("<password>{0}</password>", defaultPassword);
            credentialXML.Append("</credential>");

            //The csharp toolkit encodes the credentials
            string encodedCredentials = credentialXML.ToString();
            xmlEncodedXML xmlEncodedCredentials = new xmlEncodedXML();
            xmlEncodedCredentials.Value = encodedCredentials;
            searchPathSingleObject[] emptyRoleSearchPathList = new searchPathSingleObject[0];
            cm.logon(xmlEncodedCredentials, null);

            cam_passsport = cm.biBusHeaderValue.CAM.CAMPassport.id;

        }

Thanks for the assistance!

Offline birliban

  • Full Member
  • ***
  • Posts: 19
  • Forum Citizenship: +1/-0
Re: Allow SDK connections to Cognos
« Reply #1 on: 12 Jan 2010 05:54:25 am »
Hi,

could you post the complete error message ? The real error code is somewhere in the XML message.

Offline psenechal

  • Associate
  • **
  • Posts: 2
  • Forum Citizenship: +0/-0
Re: Allow SDK connections to Cognos
« Reply #2 on: 19 Feb 2010 12:23:30 pm »
I actually figured part of it out. We do have a namespace defined, it just doesn't show up in the config file. When I added the namespace to my XML string, the logon worked fine and I'm getting back a CAM Passport.
« Last Edit: 19 Feb 2010 12:42:07 pm by psenechal »