COGNOiSe.com - The IBM Cognos Community

Legacy Business Intelligence => COGNOS ReportNet => SDK => Topic started by: rajeshdesai on 18 Apr 2006 06:09:35 AM

Title: endPointUrl error in C#.Net application (Cognos ReportNet SDK)
Post by: rajeshdesai on 18 Apr 2006 06:09:35 AM
Hello,
I try to develop an application using Cognos ReportNet SDK in C#.Net, in my LogOn form I am getting the following error message.
Property, indexer, or event 'endPointUrl' is not supported by the language; try directly calling accessor methods 'CRN._CognosReportNetService.get_endPointUrl()' or 'CRN._CognosReportNetService.set_endPointUrl(ref string)'

I have added CRN.dll  in reference of C# Windows Application. I am using the following code to logon.

         CognosReportNetService reportNet;
         reportNet = new CognosReportNetService();
         reportNet.endPointUrl = "http://localhost/crn/cgi-bin/cognosisapi.dll";

         System.Text.StringBuilder credentialXML = new System.Text.StringBuilder("<credential>" );
         credentialXML.AppendFormat( "<namespace>{0}</namespace>", txtNamespace.Text );
         credentialXML.AppendFormat( "<username>{0}</username>", txtUser.Text );
         credentialXML.AppendFormat( "<password>{0}</password>", txtPassword.Text );
         credentialXML.Append( "</credential>" );
         string encodedCredentials = credentialXML.ToString ();
         
         reportNet.logon(encodedCredentials, new CRN.StringC());

Many thanks in advance

Rajesh  :)
Title: Re: endPointUrl error in C#.Net application (Cognos ReportNet SDK)
Post by: kattaviz on 23 Apr 2006 11:19:40 PM
Hi Rajesh,

I think u r referencing the wrong DLL to access Cognos SDK. Refer to the SDK development user guide.
For .NET applications u have to refernce "cognosdotnet.dll" and cognosdotnetassembly.dll".


hope this helps.
Title: Re: endPointUrl error in C#.Net application (Cognos ReportNet SDK)
Post by: rajeshdesai on 28 Apr 2006 07:57:02 AM
Thanks Satish,

First point I want to clear is that there is only one crn.dll in Cognos ReportNet SDK. (I m not using Cognos 8)

After few investigation and research. I have found out the following 2 points which are important.

1. You cannot use COM interface in C#.Net application, you need to use WSDL reference.
(WSDL reference means adding web reference in .Net application.
e.g. Web Reference URL: http://cogdev:9080/p2pd/servlet/dispatch?wsdl)
You can check for samples in the crn/sdk/c# directory.

2. Check for anonymous access on the web server (IIS) enabled, if it gives any error (like error 404).

Thanks & Regards
Rajesh Desai  :)
Title: Re: endPointUrl error in C#.Net application (Cognos ReportNet SDK)
Post by: kattaviz on 01 May 2006 12:16:05 AM
Hi Rajesh,

The solution i had proposed is for Cognos8 SDK because i am not sure which version of CRN you are using. You are right as far as ReportNet1.1 is concerned. But Cognos8 SDK does not use WSDL and the docementation says that we have to use .NET assemblies in order to use the SDK through VisualStudio.NET

thanks