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

New Topic/Question
Reply



MultiQuote




|