1 Replies - 805 Views - Last Post: 08 October 2012 - 05:23 PM Rate Topic: -----

#1 DaCienTos  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 08-October 12

Business Objects SDK No overload for login takes '1' arguments

Posted 08 October 2012 - 05:17 PM

Hi Gurus,
New member.
I am getting this error after we changed our WebService APifrom BOXIR2 to BO40.
"No overload for login takes '1' arguments."
The code works if I use WSDLs from BOXIR2 Web Service. However, if I use the BO40, it generates the above error.

Any help will be appreciated.
Thanks,
DaCien

public byte[] getPromptedReportAsPDF(string login_ID, string login_KEY, string login_CMS, string report_name, string folder_name, string[] prompt_values) 
    {
        string errorMessage = "ERR:";
        byte[] docData = Encoding.UTF8.GetBytes(errorMessage); 
        int cnt = 0;
        int success = 0;
        int RETRIES = 10;
        while ((cnt <= RETRIES) && (success != 1))
        {
            cnt = cnt + 1;    
            // ----- BEGIN SESSION -----
            SessionProxy.EnterpriseCredential boCredential = new SessionProxy.EnterpriseCredential();
            errorMessage += " Created boCredential object. \n";
            boCredential.Login = login_ID;
            boCredential.Password = login_KEY;
            boCredential.Domain = login_CMS;
            
          // /* public SessionProxy.Session()
          //  {
          //
          //  }*/
            // instantiate a Session proxy object.
            SessionProxy.Session boSession = new SessionProxy.Session();
            //SessionProxy.SessionInfo boSession = new SessionProxy.SessionInfo();
            errorMessage += " Created boSession object. \n";
            SessionProxy.SessionInfo boSI = boSession.login(boCredential);
            errorMessage += " Created boSI object. \n";
            //Formula1 mySecondCar = new Formula1("Formula1"); 
            string sid = boSI.SessionID;
            try
            {
                // instantiate a BIPlatform proxy object.
                BIPlatformProxy.BIPlatform bip = new BIPlatformProxy.BIPlatform();
                errorMessage += " Created bip object. \n";
                BIPlatformProxy.GetOptions go = new BIPlatformProxy.GetOptions();
                errorMessage += " Created go object. \n";
                // query for the report id
                BIPlatformProxy.ResponseHolder rh = bip.Get(sid, "path://InfoObjects/Root Folder/" + folder_name + "/" + report_name, go);
                errorMessage += " Created go object. \n";
                string report_id = rh.InfoObjects.InfoObject[0].CUID;
                // ----- A REPORT WITH PROMPTS AS PDF -----
                // retrieve a document's data with a documentInformation object, 
                // pass an instance to the getDocumentInformation method to get prompt info, 
                // To get a different view, set the ViewSupport type for the RetrieveData object
                ReportEngineProxy.ViewSupport pdfViewSupport = new ReportEngineProxy.ViewSupport();
                errorMessage += " Created pdfViewSupport object. \n";
                pdfViewSupport.ViewType = ReportEngineProxy.ViewType.BINARY;
                pdfViewSupport.OutputFormat = ReportEngineProxy.OutputFormatType.PDF;
                pdfViewSupport.ViewMode = ReportEngineProxy.ViewModeType.DOCUMENT;
                ReportEngineProxy.RetrieveBinaryView retBinView = new ReportEngineProxy.RetrieveBinaryView();
                errorMessage += " Created retBinView object. \n";
                retBinView.ViewSupport = pdfViewSupport;
                ReportEngineProxy.RetrieveData retBOData = new ReportEngineProxy.RetrieveData();
                retBOData.RetrieveView = retBinView;
                // instantiate a ReportEngine proxy object.
                ReportEngineProxy.ReportEngine report_engine = new ReportEngineProxy.ReportEngine();
                errorMessage += " Created report_engine object. \n";
                // for a document with prompts, the RetrieveMustFillInfo object
                // must contain a RetreivePromptInfo object
                ReportEngineProxy.RetrieveMustFillInfo retMustFill = new ReportEngineProxy.RetrieveMustFillInfo();
                errorMessage += " Created retMustFill object. \n";
                retMustFill.RetrievePromptsInfo = new ReportEngineProxy.RetrievePromptsInfo();
                // the getDocumentInformation method returns a DocumentInformation 
                // corresponding to a unique ID (UID) or document reference 
                // and a list of PromptInfo to be filled for that document
                ReportEngineProxy.Action[] actions = new ReportEngineProxy.Action[2];
                errorMessage += " Created actions object. \n";
                actions[0] = new ReportEngineProxy.Refresh();
                //System.Threading.Thread.Sleep(25000);
                ReportEngineProxy.DocumentInformation document_info = report_engine.getDocumentInformation(sid, report_id, retMustFill, actions, null, retBOData);
                errorMessage += " Created document_info object. \n";
                if (document_info.MustFillPrompts == true)
                {
                    // add an array of FillPrompt objects to the Action vector
                    // to be passed to a second call of getDocumentInformation
                    ReportEngineProxy.PromptInfo[] prompts = document_info.PromptInfo;
                    if (prompts.Length == prompt_values.Length)
                    {
                        int iPrompts = prompts.Length;
                        ReportEngineProxy.FillPrompt[] fillPromptList = new ReportEngineProxy.FillPrompt[iPrompts];
                        ReportEngineProxy.DiscretePromptValue[] dPromptValues;
                        for (int i = 0; i < iPrompts; i++)
                        {
                            // fill prompts with discrete prompt values
                            errorMessage += "Prompt" + i + ":" + prompt_values[i] + " ";
                            dPromptValues = new ReportEngineProxy.DiscretePromptValue[1];
                            dPromptValues[0] = new ReportEngineProxy.DiscretePromptValue();
                            dPromptValues[0].Value = prompt_values[i];
                            fillPromptList[i] = new ReportEngineProxy.FillPrompt();
                            fillPromptList[i].ID = prompts[i].ID;
                            fillPromptList[i].Values = dPromptValues;
                        }
                        ReportEngineProxy.FillPrompts fillPrompts = new ReportEngineProxy.FillPrompts();
                        fillPrompts.FillPromptList = fillPromptList;
                        actions[1] = fillPrompts;
                    }
                    else
                    {
                        // the correct number of parameters was not passed in
                        errorMessage += "Number of prompt values does not match number of prompts to fill.";
                    }
                }
                // the getDocumentInformation method now returns completed DocumentInformation 
                document_info = report_engine.getDocumentInformation(sid, report_id, null, actions, null, retBOData);
                ReportEngineProxy.BinaryView rep_view = (ReportEngineProxy.BinaryView)document_info.View;
                docData = rep_view.Content;
                //byte[] docData = rep_view.Content;
                //Test the sleep time to make sure apps has a stable connection to the ws provider 12/17/2007 
                //System.Threading.Thread.Sleep(100);
                boSession.logout(sid);
                errorMessage += " logout(sid) in try. \n";
                success = 1;
                //return docData;
                // ----- END SESSION ----- comment out 12/20/2007
                //boSession.logout(sid);
            }
           
            catch (SystemException exc)
            {
                boSession.logout(sid);
                errorMessage += " logout(sid) in catch. \n";
                errorMessage += exc.ToString();
                docData = Encoding.UTF8.GetBytes(errorMessage);
                //return Encoding.UTF8.GetBytes(errorMessage);               
            }
        }
        return docData;
    } // getPromptedReportAsPDF

This post has been edited by JackOfAllTrades: 09 October 2012 - 03:15 AM
Reason for edit:: Fixed code


Is This A Good Question/Topic? 0
  • +

Replies To: Business Objects SDK No overload for login takes '1' arguments

#2 tlhIn`toq  Icon User is online

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5316
  • View blog
  • Posts: 11,355
  • Joined: 02-June 10

Re: Business Objects SDK No overload for login takes '1' arguments

Posted 08 October 2012 - 05:23 PM

Quote

"No overload for login takes '1' arguments."


What the error is saying is you are trying to call a method while providing 1 argument - but the method doesn't have such a call. Maybe it has a call with no arguments, or maybe it needs 4 - who knows?

But you should see the correct signature pop up through Intellisense as you're typing. Use that as your guide to how many arguments you need and of what type and order to provide them.

And please repost your code correctly. THis looks a LOT like you copy/pasted from another forum where it was a bullet point list.

:code:
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1