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 :)
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.
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 :)
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