This topic describes the functions contained within WebFOCUS Web Services.
WebFocus is the Web Service name associated with the set of WebFOCUS Web Service functions. The Service Name <service name="WebFocus"> can be found towards the end of the WSDL file that is created in the steps described in Using the WebFOCUS WSDL Creation Utility.
Function Name: WebFocusLogOn
Purpose: To authenticate against the security set up in the WebFOCUS environment. If the authentication is successful, the WebFOCUS cookies are set and the cookie information is returned. This cookie information is the first parameter of every subsequent WebFOCUS Web Service function call.
Input:
Description |
Type |
---|---|
WebFOCUS Reporting Server user ID. If the WebFOCUS Reporting Server is unsecured, this parameter should be set to Null. |
String |
WebFOCUS Reporting Server password. If the WebFOCUS Reporting Server is unsecured, this parameter should be set to Null. |
String |
Managed Reporting user ID. If Managed Reporting is not being used, this parameter should be set to Null. |
String |
Managed Reporting password. If Managed Reporting is not being used, this parameter should be set to Null. |
String |
Output:
Description |
Type |
---|---|
Structure that contains cookie information. |
LogOnInfo |
In the following example, the status of authentication is written to the WebFocusLogOn.txt file in the c:\temp directory.
Dim wfs As New MR.WebFocus Dim logon As New MR.LogOnInfo Dim newOutput As String = "" Dim tempfile As String logon = wfs.WebFocusLogOn("RepUser", "RepPass", "admin", "") newOutput = logon.status tempfile = "c:\temp\WebFocusLogOn.txt" FileOpen(1, tempfile, OpenMode.Output) Print(1, newOutput) FileClose(1)
Note: MR is the name of the Web Reference.
In the following example, the status of authentication is written to the WebFocusLogOn.txt file in the c:\temp directory.
try { WebFocus WFservice = new WebFocusLocator(); WebFocusSoap_PortType wfs = WFservice.getWebFocusSoap(); LogOnInfo logon = wfs.webFocusLogOn("RepUser","RepPass","admin",""); boolean newOutput=logon.isStatus(); File tempfile = new File("c:\\temp\\WebFocusLogOn.txt"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); out.println(newOutput); out.close(); } catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
Function Name: Name of the WebFOCUS report or alias function name.
Purpose: To run a WebFOCUS report created as a Web Service function.
WebFocusFexEntry0
to
WebFocusFexEntry9
The alias function is an alternate method of calling a WebFOCUS report. Each report selected in the WSDL creation utility has an alias function. The alias function is listed under the actual WebFOCUS report name in the WSDL creation utility when the Pick Functions option is selected. For more information, see Using the WebFOCUS WSDL Creation Utility.
For example,
Is the actual report definition.
Is the alias report definition.
The alias function name can be from
MREFexEntry0
to
MREFexEntry9
The alias function is the alternate method of calling a WebFOCUS report. Each report that is selected in the WSDL creation utility has an alias function. The alias function is listed under short name for the WebFOCUS report in the WSDL creation utility when the Pick Functions option is selected.
For example,
Is the actual report definition.
Is the alias report definition.
Input:
Description |
Type |
---|---|
WebFOCUS cookie information. |
LogOnInfo |
Parameters of the WebFOCUS report. Certain Java Development environments and .NET display the parameters of the Web Service function. Otherwise, the WSDL file can be interrogated to determine the parameters. |
String |
Output:
Description |
Type |
---|---|
Structure that contains the output from a WebFOCUS report. |
WebFocusReturn |
The following example shows the input definition of the Web Service function Sales_Report from the WSDL file that shows REGION as the parameter.
<s:element minOccurs="1" maxOccurs="1" name="IBIWS_cookie" type="ibi:LogOnInfo"/> <s:element minOccurs="1" maxOccurs="1" name="REGION" type="s:string" />
In the following example, the output of a WebFOCUS report named Sales_Report is written to the Sales_Report file in the c:\temp directory. The parameter for this report is REGION.
Dim wfs As New SelfServe.WebFocus Dim logon As New SelfServe.LogOnInfo Dim ret As New SelfServe.WebFocusReturn Dim newOutput As String = "" Dim tempfile As String logon = wfs.WebFocusLogOn("RepUser", "RepPass", "", "") ret = wfs.sales_report(logon, "EASTERN") newOutput = ret.output tempfile = "c:\temp\Sales_Report.htm" FileOpen(1, tempfile, OpenMode.Output) Print(1, newOutput) FileClose(1)
Note: SelfServe is the name of the Web Reference.
In the following example, the output of a WebFOCUS report named Sales_Report is written to the Sales_Report file in the c:\temp directory. The parameter for this report is REGION.
try { WebFocus WFservice = new WebFocusLocator(); WebFocusSoap_PortType wfs = WFservice.getWebFocusSoap(); LogOnInfo logon = wfs.webFocusLogOn("RepUser","RepPass","",""); WebFocusReturn ret = wfs.sales_report(logon,"EASTERN"); String newOutput=ret.getOutput(); File tempfile = new File("c:\\temp\\Sales_Report.htm"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); out.println(newOutput); out.close(); } catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
Function Name: WebFocusRunFex
Purpose: To run a WebFOCUS report.
Input:
Description |
Type |
---|---|
WebFOCUS cookie information. |
LogOnInfo |
WebFOCUS report run information. |
FexInfo |
Output:
Description |
Type |
---|---|
Structure that contains the output from a WebFOCUS report. |
WebFocusReturn |
In the following example, the output of a WebFOCUS report named Sales_Report_2 is written to a file in the c:\temp directory if a format of HTML is specified in the FMT parameter of the report. If a format of EXL2K is specified, output is written to the Sales_Report_2.xls file in the c:\temp directory. The other parameter for this report is REGION.
Dim wfs As New SelfServe.WebFocus Dim logon As New SelfServe.LogOnInfo Dim ret As New SelfServe.WebFocusReturn Dim report As New SelfServe.FexInfo Dim param1 As New SelfServe.ValuesArrayEntry Dim param2 As New SelfServe.ValuesArrayEntry Dim params As Array = Array.CreateInstance(GetType(SelfServe.ValuesArrayEntry), 2) Dim newOutput As String = "" Dim tempfile As String
param1.name = "REGION" param1.val = "EASTERN" params(0) = param1 param2.name = "FMT" param2.val = "HTML" params(1) = param2
report.server = "EDASERVE" report.app = "Sales_Demo" report.name = "Sales_Report_2" report.IBIWS_arrayvalues = params logon = wfs.WebFocusLogOn("RepUser", "RepPass", "", "") ret = wfs.WebFocusRunFex(logon, report) newOutput = ret.output
If ret.mime = "application/vnd.ms-excel" Then tempfile = "c:\temp\Sales_Report_2.xls" Else : tempfile = "c:\temp\Sales_Report_2.htm" End If FileOpen(1, tempfile, OpenMode.Output) Print(1, newOutput) FileClose(1)
Note: SelfServe is the name of the Web Reference.
In the following example, the output of a WebFOCUS report named Sales_Report_2 is written to a file in the c:\temp directory if a format of HTML is specified in the FMT parameter of the report. If a format of EXL2K is specified, output is written to the Sales_Report_2.xls file in the c:\temp directory. The other parameter for this report is REGION.
try { WebFocus WFservice = new WebFocusLocator(); WebFocusSoap_PortType wfs = WFservice.getWebFocusSoap(); ValuesArrayEntry[] param; param = new ValuesArrayEntry[2]; ValuesArrayEntry param1 = new ValuesArrayEntry(); param1.setName("REGION"); param1.setVal("EASTERN"); param[0] = param1; ValuesArrayEntry param2 = new ValuesArrayEntry(); param2.setName("FMT"); param2.setVal("HTML"); param[1] = param2; FexInfo report = new FexInfo(); report.setServer("EDASERVE"); report.setApp("Sales_Demo"); report.setName("Sales_Report_2"); report.setIBIWS_arrayvalues(param);
LogOnInfo logon = wfs.webFocusLogOn("RepUser","RepPass","",""); WebFocusReturn ret = wfs.webFocusRunFex(logon,report); String newOutput=ret.getOutput(); File tempfile = null; if (ret.getMime().equals ("application/vnd.ms-excel")) tempfile = new File("c:\\temp\\Sales_Report_2.xls"); else tempfile = new File("c:\\temp\\Sales_Report_2.htm"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); out.println(newOutput); out.close(); } catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
In the following example, the output of a WebFOCUS report named Sales_Report_2 is written to a file in the c:\temp directory if a format of HTML is specified in the FMT parameter of the report. If a format of EXL2K is specified, output is written to the Sales_Report_2.xls file in the c:\temp directory. Values of "EASTERN" and "CORPORATE" are passed to the REGION parameter.
Dim wfs As New SelfServe.WebFocus Dim logon As New SelfServe.LogOnInfo Dim ret As New SelfServe.WebFocusReturn Dim report As New SelfServe.FexInfo Dim param1 As New SelfServe.ValuesArrayEntry Dim param2 As New SelfServe.ValuesArrayEntry Dim multivalues As Array = Array.CreateInstance(GetType(String), 2) Dim params As Array = Array.CreateInstance(GetType(SelfServe.ValuesArrayEntry), 2) Dim newOutput As String = "" Dim tempfile As String param1.name = "REGION" multivalues(0) = "EASTERN" multivalues(1) = "CORPORATE" param1.StringArray = multivalues param1.multi = True param1.quote = True param1.operation = "OR" params(0) = param1 param2.name = "FMT" param2.val = "HTML" params(1) = param2
report.server = "EDASERVE" report.app = "Sales_Demo" report.name = "Sales_Report_2" report.IBIWS_arrayvalues = params logon = wfs.WebFocusLogOn("RepUser", "RepPass", "", "") ret = wfs.WebFocusRunFex(logon, report) newOutput = ret.output If ret.mime = "application/vnd.ms-excel" Then tempfile = "c:\temp\Sales_Report_2.xls" Else : tempfile = "c:\temp\Sales_Report_2.htm" End If FileOpen(1, tempfile, OpenMode.Output) Print(1, newOutput) FileClose(1)
Note: SelfServe is the name of the Web Reference.
In the following example, the output of a WebFOCUS report named Sales_Report_2 is written to a file in the c:\temp directory if a format of HTML is specified in the FMT parameter of the report. If a format of EXL2K is specified, output is written to the Sales_Report_2.xls file in the c:\temp directory. Values of "EASTERN" and "CORPORATE" are passed to the REGION parameter.
try { WebFocus WFservice = new WebFocusLocator(); WebFocusSoap_PortType wfs = WFservice.getWebFocusSoap(); ValuesArrayEntry[] param; param = new ValuesArrayEntry[2]; ValuesArrayEntry param1 = new ValuesArrayEntry(); String[] multivalues; multivalues = new String[2]; param1.setName("REGION"); multivalues[0] = "EASTERN"; multivalues[1] = "CORPORATE"; param1.setStringArray(multivalues); param1.setMulti(true); param1.setQuote(true); param1.setOperation("OR"); param[0] = param1; ValuesArrayEntry param2 = new ValuesArrayEntry(); param2.setName("FMT"); param2.setVal("HTML"); param[1] = param2;
FexInfo report = new FexInfo(); report.setServer("EDASERVE"); report.setApp("Sales_Demo"); report.setName("Sales_Report_2"); report.setIBIWS_arrayvalues(param); LogOnInfo logon = wfs.webFocusLogOn("RepUser","RepPass","",""); WebFocusReturn ret = wfs.webFocusRunFex(logon,report); String newOutput=ret.getOutput(); File tempfile = null; if (ret.getMime().equals ("application/vnd.ms-excel")) tempfile = new File("c:\\temp\\Sales_Report_2.xls"); else tempfile = new File("c:\\temp\\Sales_Report_2.htm"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); out.println(newOutput); out.close(); } catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
In the following example, the output of a WebFOCUS report named GetQuotes is written from Managed Reporting to the GetQuotes.htm file in the c:\temp directory. The ticker symbol used as input is MSFT (Microsoft Corporation).
The HREF for the domain is used as input instead of the domain name. The following is an example of the HREF for a domain.
The HREF for the Standard Report group is used as input instead of the Standard Report group name. The following is an example of the HREF for a Standard Report group.
The file name or HREF for the WebFOCUS report is used as input instead of the WebFOCUS report name. The following example is the file name for a WebFOCUS report.
Dim wfs As New MR.WebFocus Dim logon As New MR.LogOnInfo Dim ret As New MR.WebFocusReturn Dim report As New MR.FexInfo Dim param1 As New MR.ValuesArrayEntry Dim params As Array = Array.CreateInstance(GetType(MR.ValuesArrayEntry),1) Dim newOutput As String = "" Dim tempfile As String param1.name = "TICKER" param1.val = "MSFT" params(0) = param1 report.MREdomain = "webservi/webservi.htm" report.MREfolder = "#soapadapterk" report.name = "app/zoh9uv5k.fex" report.IBIWS_arrayvalues = params logon = wfs.WebFocusLogOn("RepUser", "RepPass", "admin", "") ret = wfs.WebFocusRunFex(logon, report) newOutput = ret.output tempfile = "c:\temp\GetQuotes.htm" FileOpen(1, tempfile, OpenMode.Output) Print(1, newOutput) FileClose(1)
Note: MR is the name of the Web Reference.
In the following example, the output of a WebFOCUS report named GetQuotes is written from Managed Reporting to the GetQuotes.htm file in the c:\temp directory. The ticker symbol used as input is MSFT (Microsoft Corporation).
The HREF for the domain is used as input instead of the domain name. The following is an example of the HREF for a domain.
The HREF for the Standard Report group is used as input instead of the Standard Report group name. The following is an example of the HREF for a Standard Report group.
The file name or HREF for the WebFOCUS report is used as input instead of the WebFOCUS report name. The following example is the file name for a WebFOCUS report.
try { WebFocus WFservice = new WebFocusLocator(); WebFocusSoap_PortType wfs = WFservice.getWebFocusSoap(); ValuesArrayEntry[] param; param = new ValuesArrayEntry[1]; ValuesArrayEntry param1 = new ValuesArrayEntry(); param1.setName("TICKER"); param1.setVal("MSFT"); param[0] = param1; FexInfo report = new FexInfo(); report.setMREdomain("webservi/webservi.htm"); report.setMREfolder("#soapadapterk"); report.setName("app/zoh9uv5k.fex"); report.setIBIWS_arrayvalues(param); LogOnInfo logon = wfs.webFocusLogOn("RepUser","RepPass","admin",""); WebFocusReturn ret = wfs.webFocusRunFex(logon,report); String newOutput=ret.getOutput(); File tempfile = new File("c:\\temp\\GetQuotes.htm"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); out.println(newOutput); out.close(); } catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
In the following example, WebFOCUS code is sent as input, and the output is written to the Adhoc.htm file in the c:\temp directory.
Dim wfs As New SelfServe.WebFocus Dim logon As New SelfServe.LogOnInfo Dim ret As New SelfServe.WebFocusReturn Dim newOutput As String = "" Dim tempfile As String Dim report As New SelfServe.FexInfo Dim FocCode As String Dim CRLF As String Dim FC1 As String Dim FC2 As String Dim FC3 As String Dim FC4 As String CRLF = vbCrLf FC1 = "TABLE FILE CAR" FC2 = "SUM DEALER_COST" FC3 = "BY COUNTRY" FC4 = "END" FocCode = FC1 + CRLF + FC2 + CRLF + FC3 + CRLF + FC4 report.server = "EDASERVE" report.adhocfex = FocCode logon = wfs.WebFocusLogOn("RepUser", "RepPass", "", "") ret = wfs.WebFocusRunFex(logon, report) newOutput = ret.output tempfile = "c:\temp\Adhoc.htm" FileOpen(1, tempfile, OpenMode.Output) Print(1, newOutput) FileClose(1)
Note: SelfServe is the name of the Web Reference.
In the following example, WebFOCUS code is sent as input, and the output is written to the Adhoc.htm file in the c:\temp directory.
try { WebFocus WFservice = new WebFocusLocator(); WebFocusSoap_PortType wfs = WFservice.getWebFocusSoap(); WebFocusReturn ret; FexInfo report = new FexInfo(); String CRLF = System.getProperty("line.separator"); String FC1 = "TABLE FILE CAR"; String FC2 = "SUM DEALER_COST"; String FC3 = "BY COUNTRY"; String FC4 = "END"; String FocCode = FC1 + CRLF + FC2 + CRLF + FC3 + CRLF + FC4; report.setServer("EDASERVE"); report.setAdhocfex(FocCode); LogOnInfo logon = wfs.webFocusLogOn("RepUser","RepPass","",""); ret = wfs.webFocusRunFex(logon,report); String newOutput=ret.getOutput(); File tempfile = new File("c:\\temp\\Adhoc.htm"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); out.println(newOutput); out.close(); } catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
Function Name: WebFocusRunFex1
Purpose: To run a WebFOCUS report that uses active cache or On Demand Paging functionality. The WebFocusLogOn function is run to authenticate to WebFOCUS. The cookies contained in the response are stored in a session variable to later be used by the WebFocusRunReq function to perform paging functionality. For WebFOCUS reports containing On Demand Paging, an alias called ibi_html pointing to the WebFOCUS77\ibi_html directory must be configured within the Web Server. For example, a Visual Studio application which uses IIS as the Web Server must have the ibi_html alias configured.
Description |
Type |
---|---|
WebFOCUS cookie information. |
LogOnInfo |
WebFOCUS report run information. |
FexInfo |
The link to the client application that is used to perform paging. |
String |
Output:
Description |
Type |
---|---|
Structure that contains the output from a WebFOCUS report. |
WebFocusReturn |
In the following example, a WebFOCUS report containing active cache functionality named ActiveCache is run. The WebFocusLogOn function is first run to authenticate to WebFOCUS. The cookies contained in the response are stored in a session variable called LogonCookies. These cookies will be used by the WebFocusRunReq function which performs the paging functionality. When a user performs any of the paging within the WebFOCUS report created by the WebFocusRunFex1 function, in this example http://localhost:62914/WebForm2.aspx will be run to perform the paging functionality.
Public Class _Default Inherits System.Web.UI.Page Dim newOutput As String Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim wfs As New WF.WebFocusSoapClient Dim LogonCookies As New WF.LogOnInfo Dim FexinfoIn As New WF.FexInfo Dim retWF As WF.WebFocusReturn LogonCookies = wfs.WebFocusLogOn("", "", "admin", "") System.Web.HttpContext.Current.Session("LogonCookies") = LogonCookies FexinfoIn.server = "EDASERVE" FexinfoIn.app = "IBISAMP" FexinfoIn.name = "ActiveCache" retWF = wfs.WebFocusRunFex1(LogonCookies, FexinfoIn, "http://localhost:62914/WebForm2.aspx") newOutput = retWF.output End Sub Protected Overrides Sub Render(ByVal output As HtmlTextWriter) output.Write(newOutput) End Sub End Class
Function Name: WebFocusRunReq
Purpose: To page within a WebFOCUS report containing active cache or On Demand Paging functionality, which was created with the WebFocusRunFex1 function. The cookies stored in the session variable in the step of running the initial report using the WebFocusRunFex1 function are retrieved and used as the first parameter to the WebFocusRunReq function. The Query String passed to the client application is used as the second parameter of the WebFocusRunReq function. An active cache report utilizes an HTTP POST request where an On Demand Paging utilizes an HTTP GET request. For WebFOCUS reports containing On Demand Paging, an alias called ibi_html pointing to the WebFOCUS77\ibi_html directory must be configured within the Web Server. For example, a Visual Studio application which uses IIS as the Web Server must have the ibi_html alias configured.
Input:
Description |
Type |
---|---|
WebFOCUS cookie information. |
LogOnInfo |
Query String which contains the Name/Value pairs indicating the paging to be performed. |
String |
The link to the client application that is used to perform paging. |
String |
Output:
Description |
Type |
---|---|
Structure that contains the output from a WebFOCUS report. |
WebFocusReturn |
In the following example, WebForm2.aspx is run from the result of a user performing paging functionality within an active cache report created by the WebFocusRunFex1 function. The cookies stored in the session variable called LogonCookies, which were created from the step of running the initial report using the WebFocusRunFex1 function, are retrieved. The Name/Value pairs of the Query String are concatenated together to create a string of all the paging parameters. When a user performs any of the paging within the WebFOCUS report, in this example http://localhost:62914/WebForm2.aspx will be run to perform the paging functionality.
Public Class WebForm2 Inherits System.Web.UI.Page Dim newOutput As String Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim DrillURL As String Dim tDrillURL As String Dim wfs As New WF.WebFocusSoapClient Dim Logon As New WF.LogOnInfo Dim retWF As New WF.WebFocusReturn Dim i As Integer Dim qValue As String Logon = System.Web.HttpContext.Current.Session("LogonCookies") tDrillURL = "" If Request.QueryString.AllKeys.Length = 0 Then 'Active Cache Paging For i = 0 To Request.Form.AllKeys.Length - 1 qValue = Request.Form(Request.Form.AllKeys(i)) If i = 0 Then tDrillURL = tDrillURL + Request.Form.AllKeys(i) + "=" + qValue
Else tDrillURL = tDrillURL + "&" + Request.Form.AllKeys(i) + "=" + qValue End If Next i Else 'On Demand Paging For i = 0 To Request.QueryString.AllKeys.Length - 1 qValue = Request.QueryString(Request.QueryString.AllKeys(i)) If i = 0 Then tDrillURL = tDrillURL + Request.QueryString.AllKeys(i) + "=" + qValue Else tDrillURL = tDrillURL + "&" + Request.QueryString.AllKeys(i) + "=" + qValue End If Next i End If DrillURL = Replace(tDrillURL, " ", "%20") retWF = wfs.WebFocusRunReq(Logon, DrillURL, "http://localhost:62914/WebForm2.aspx") newOutput = retWF.output End Sub Protected Overrides Sub Render(ByVal output As HtmlTextWriter) output.Write(newOutput) End Sub End Class
Function Name: WebFocusRunFexExtended
Purpose: To run a WebFOCUS Report that utilizes the input passed in the function and is able to resolve any links created in a Drill-Down report or Graph. The links can be resolved to an array of output or WebArchive (.mht) format.
Input:
Description |
Type |
---|---|
WebFOCUS cookie information. |
LogOnInfo |
WebFOCUS run information. |
FexInfo |
Report Output Definition. |
MulitOutputFormat |
Input data to be used at run time. |
InputData |
Output:
Description |
Type |
---|---|
Structure that contains the array of output from a WebFOCUS report. |
WebFocusReturn array |
In the following example, a report called OrderReport from the IBINCCEN application is run utilizing input data that is used to create a temporary DECODE table called statecd.ftm. One level of Drill-Downs is resolved with the output returned in WebArchive format. The output from the function is written to the Output.mht file in the c:\temp directory.
Dim wfs As New SelfServe.WebFocus Dim logon As New SelfServe.LogOnInfo Dim FexInfoIn As New SelfServe.FexInfo Dim InputInclude As New SelfServe.InputData Dim multiOutput As New SelfServe.MultiOutputFormat Dim retWF() As SelfServe.WebFocusReturn Dim newOutput As String Dim tempfile As String FexInfoIn.server = "EDASERVE" FexInfoIn.app = "IBINCCEN" FexInfoIn.name = "OrderReport" multiOutput.format = SelfServe.MultiOutputType.webarchive multiOutput.levels = 1 multiOutput.dowfdrills = True InputInclude.name = "statecd" InputInclude.text = "FL 'Florida' " + vbCrLf + _ "NC 'North Carolina' " + vbCrLf + _ "NY 'New York' " logon = wfs.WebFocusLogOn("RepUser", "RepPass", "", "") retWF = wfs.WebFocusRunFexExtended(logon, FexInfoIn, multiOutput, InputInclude) tempfile = "c:\temp\Output.mht" newOutput = retWF(0).output FileOpen(1, tempfile, OpenMode.Output) Print(1, newOutput) FileClose(1)
Note: SelfServe is the name of the Web Reference.
In the following example, a report called OrderReport from the IBINCCEN application is run utilizing input data that is used to create a temporary DECODE table called statecd.ftm. One level of Drill-Downs is resolved with the output returned in WebArchive format. The output from the function is written to the Output.mht file in the c:\temp directory.
try { WebFocus WFservice = new WebFocusLocator(); WebFocusSoap_PortType wfs = WFservice.getWebFocusSoap(); FexInfo FexInfoIn = new FexInfo(); FexInfoIn.setServer("EDASERVE"); FexInfoIn.setApp("IBINCCEN"); FexInfoIn.setName("OrderReport"); MultiOutputFormat multiOutput = new MultiOutputFormat(); multiOutput.setFormat(MultiOutputType.webarchive); multiOutput.setLevels(1); multiOutput.setDowfdrills(true); String CRLF = System.getProperty("line.separator"); InputData InputInclude = new InputData(); InputInclude.setName("statecd"); InputInclude.setText("FL 'Florida'" + CRLF + "NC 'North Carolina'" + CRLF + "NY 'New York'"); LogOnInfo logon = wfs.webFocusLogOn("RepUser","RepPass","",""); WebFocusReturn[] retWF = wfs.webFocusRunFexExtended(logon,FexInfoIn,multiOutput,InputInclude);
String newOutput=retWF[0].getOutput(); File tempfile = new File("c:\\temp\\Output.mht"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); out.println(newOutput); out.close(); } catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
In the following example, a report called SalesRepsXML from the BASEAPP application is run utilizing XML data which is read in from a file called SalesReps.xml. The output from the function is written to the ReportXML.htm file in the c:\temp directory.
The following is the content of the SalesReps.xml file.
<?xml version="1.0" encoding="UTF-8"?> <SalesReps> <SalesRep> <Name>Carole Fernandez</Name> <City>Boston</City> <State>MA</State> <Country>USA</Country> </SalesRep> <SalesRep> <Name>Dave Wheelock</Name> <City>Houston</City> <State>TX</State> <Country>USA</Country> </SalesRep> <SalesRep> <Name>Phil McRell</Name> <City>Chicago</City> <State>IL</State> <Country>USA</Country> </SalesRep> </SalesReps>
In order to create a report against the XML data, a Master File must first be created. This can be done by utilizing the Create Synonym utility in the WebFOCUS Server Console.
Right-click on XML in the configured adapters and select Create Synonym.
Enter the directory where the XML file exists in both the Collection of XML definitions and Directory Path. Also, enter XML for the Files Extension and click the Next button.
Check the box next to the XML file name for which a Master File is to be created. Select the application where the Master File is to be put from the drop-down box. Make Unique and Validate should also be checked in order to ensure that all FIELDNAMES within the Master File are unique. Click the Create Synonym button.
The following is the Master File created from the Create Synonym process using the SalesReps.xml file.
FILENAME=BASEAPP_SALESREPS, SUFFIX=XML , $ SEGMENT=SALESREPS, SEGTYPE=S0, $ FIELDNAME=SALESREPS, ALIAS=SalesReps, USAGE=A1, ACTUAL=A1, MISSING=ON, ACCESS_PROPERTY=(INTERNAL), $ SEGMENT=SALESREP, SEGTYPE=S0, PARENT=SALESREPS, $ FIELDNAME=SALESREP, ALIAS=SalesRep, USAGE=A1, ACTUAL=A1, MISSING=ON, ACCESS_PROPERTY=(INTERNAL), REFERENCE=SALESREPS, PROPERTY=ELEMENT, $ FIELDNAME=NAME, ALIAS=Name, USAGE=A55, ACTUAL=A55, MISSING=ON, REFERENCE=SALESREP, PROPERTY=ELEMENT, $ FIELDNAME=CITY, ALIAS=City, USAGE=A55, ACTUAL=A55, MISSING=ON, REFERENCE=SALESREP, PROPERTY=ELEMENT, $ FIELDNAME=STATE, ALIAS=State, USAGE=A55, ACTUAL=A55, MISSING=ON, REFERENCE=SALESREP, PROPERTY=ELEMENT, $ FIELDNAME=COUNTRY, ALIAS=Country, USAGE=A55, ACTUAL=A55, MISSING=ON, REFERENCE=SALESREP, PROPERTY=ELEMENT, $
The following is a WebFOCUS procedure example which reports against the passed XML data. Ensure that there is a FILEDEF statement in the procedure. Notice that there is no path defined to the XML file as the WebFocusRunFexExtended function passes the XML data to a temporary location in the WebFOCUS environment.
FILEDEF SALESREPS DISK SalesReps.xml TABLE FILE SALESREPS PRINT NAME CITY STATE COUNTRY END
The following is the Visual Basic .NET example used to report against the XML data passed in the WebFocusRunFexExtended function.
Dim wfs As New SelfServe.WebFocus Dim logon As New SelfServe.LogOnInfo Dim FexInfoIn As New SelfServe.FexInfo Dim InputInclude As New SelfServe.InputData Dim multiOutput As New SelfServe.MultiOutputFormat Dim retWF() As SelfServe.WebFocusReturn Dim newOutput AsString Dim tempfile AsString Dim xmlData As New System.Xml.XmlDocument Dim xmlParm As System.Xml.XmlElement xmlData.Load("c:\SalesReps.xml") xmlParm = xmlData.DocumentElement FexInfoIn.server = "EDASERVE" FexInfoIn.app = "BASEAPP" FexInfoIn.name = "SalesRepsXML" multiOutput.format = SelfServe.MultiOutputType.original InputInclude.name = "SalesReps" InputInclude.xml = xmlParm logon = wfs.WebFocusLogOn("RepUser", "RepPass","", "") retWF = wfs.WebFocusRunFexExtended(logon, FexInfoIn, multiOutput, InputInclude) tempfile = "c:\temp\ReportXML.htm" newOutput = retWF(0).output FileOpen(1, tempfile, OpenMode.Output) Print(1, newOutput) FileClose(1)
Note: SelfServe is the name of the Web Reference.
In the following example, a report called SalesRepsXML from the BASEAPP application is run utilizing XML data which is read in from a file called SalesReps.xml. The output from the function is written to the ReportXML.htm file in the c:\temp directory.
The following is the content of the SalesReps.xml file.
<?xml version="1.0" encoding="UTF-8"?> <SalesReps> <SalesRep> <Name>Carole Fernandez</Name> <City>Boston</City> <State>MA</State> <Country>USA</Country> </SalesRep> <SalesRep> <Name>Dave Wheelock</Name> <City>Houston</City> <State>TX</State> <Country>USA</Country> </SalesRep> <SalesRep> <Name>Phil McRell</Name> <City>Chicago</City> <State>IL</State> <Country>USA</Country> </SalesRep> </SalesReps>
In order to create a report against the XML data, a Master File must first be created. This can be done by utilizing the Create Synonym utility in the WebFOCUS Server Console.
Right-click on XML in the configured adapters and select Create Synonym.
Enter the directory where the XML file exists in both the Collection of XML definitions and Directory Path. Also, enter XML for the Files Extension and click the Next button.
Check the box next to the XML file name for which a Master File is to be created. Select the application where the Master File Description is to be put from the drop-down box. Make Unique and Validate should also be checked in order to ensure that all FIELDNAMES within the Master File are unique. Click the Create Synonym button.
The following is the Master File created from the Create Synonym process using the SalesReps.xml file.
FILENAME=BASEAPP_SALESREPS, SUFFIX=XML , $ SEGMENT=SALESREPS, SEGTYPE=S0, $ FIELDNAME=SALESREPS, ALIAS=SalesReps, USAGE=A1, ACTUAL=A1, MISSING=ON, ACCESS_PROPERTY=(INTERNAL), $ SEGMENT=SALESREP, SEGTYPE=S0, PARENT=SALESREPS, $ FIELDNAME=SALESREP, ALIAS=SalesRep, USAGE=A1, ACTUAL=A1, MISSING=ON, ACCESS_PROPERTY=(INTERNAL), REFERENCE=SALESREPS, PROPERTY=ELEMENT, $ FIELDNAME=NAME, ALIAS=Name, USAGE=A55, ACTUAL=A55, MISSING=ON, REFERENCE=SALESREP, PROPERTY=ELEMENT, $ FIELDNAME=CITY, ALIAS=City, USAGE=A55, ACTUAL=A55, MISSING=ON, REFERENCE=SALESREP, PROPERTY=ELEMENT, $ FIELDNAME=STATE, ALIAS=State, USAGE=A55, ACTUAL=A55, MISSING=ON, REFERENCE=SALESREP, PROPERTY=ELEMENT, $ FIELDNAME=COUNTRY, ALIAS=Country, USAGE=A55, ACTUAL=A55, MISSING=ON, REFERENCE=SALESREP, PROPERTY=ELEMENT, $
The following is a WebFOCUS procedure example which reports against the passed XML data. Ensure that there is a FILEDEF statement in the procedure.
Notice that there is no path defined to the XML file as the WebFocusRunFexExtended function passes the XML data to a temporary location in the WebFOCUS environment.
FILEDEF SALESREPS DISK SalesReps.xml TABLE FILE SALESREPS PRINT NAME CITY STATE COUNTRY END
The following is the Java example used to report against the XML data passed in the WebFocusRunFexExtended function. Ensure that the following two imports are added.
import org.apache.axis.message.MessageElement; import org.apache.axis.message.SOAPBodyElement; try { WebFocus WFservice = new WebFocusLocator(); WebFocusSoap_PortType wfs = WFservice.getWebFocusSoap(); String myXML="C://SalesReps.xml"; File x = new File(myXML); FileInputStream f = new FileInputStream(x); SOAPBodyElement s = new SOAPBodyElement(f); MessageElement[] m = new MessageElement[1]; m[0] = s; InputData InputInclude = new InputData(); InputDataXml inXml = new InputDataXml(); inXml.set_any(m); InputInclude.setXml(inXml); InputInclude.setName("SalesReps"); FexInfo FexInfoIn = new FexInfo(); FexInfoIn.setName("SalesRepsXML"); FexInfoIn.setApp("BASEAPP"); MultiOutputFormat multiOutput = new MultiOutputFormat(); multiOutput.setFormat(MultiOutputType.original);
LogOnInfo logon = wfs.webFocusLogOn("RepUser","RepPass","",""); WebFocusReturn[] retWF = wfs.webFocusRunFexExtended(logon,FexInfoIn,multiOutput,InputInclude); String newOutput=retWF[0].getOutput(); File tempfile = null; tempfile = new File("c:\\temp\\ReportXml.htm"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); out.println(newOutput); out.close(); } catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
In the following example, a report called SalesRepsCSV from the BASEAPP application is run utilizing comma-delimited data which is read in from a file called SalesReps.csv. The output from the function is written to the ReportCSV.htm file in the c:\temp directory.
The following is the content of the SalesReps.csv file.
"Carole Fernandez ","Boston ","MA","USA" "Dave Wheelock ","Houston ","TX","USA" "Phil McRell ","Chicago ","IL","USA"
In order to create a report against the comma-delimited data, a Master File must first be created. This can be done by utilizing the Create Synonym utility in the WebFOCUS Server Console.
Right-click on Delimited Flat File in the configured adapters and select Create Synonym.
Enter the directory where the comma-delimited file exists in the Directory path. Also, enter the file name minus the extension in the File name text box and the file extension in the File extension text box for the comma-delimited file. Click the Select Files button.
Check the box next to the file name for which a Master File is to be created. Select the application where the Master File is to be put from the drop-down box. Enter the delimiter character in the Delimiter text box and the text enclosure character in the Enclosure text box. Make Unique and Validate should also be checked in order to ensure that all FIELDNAMES within the Master File are unique. Click the Create Synonym button.
The following is the Master File created from the Create Synonym process using the SalesReps.csv file.
FILENAME=SALESREPS, SUFFIX=DFIX , DATASET=C:\SalesReps.csv, $ SEGMENT=SALESREPS, SEGTYPE=S0, $ FIELDNAME=FIELD_1, ALIAS= , USAGE=A18, ACTUAL=A18B, $ FIELDNAME=FIELD_2, ALIAS= , USAGE=A10, ACTUAL=A10B, $ FIELDNAME=FIELD_3, ALIAS= , USAGE=A2, ACTUAL=A2B, $ FIELDNAME=FIELD_4, ALIAS= , USAGE=A3, ACTUAL=A3B, $
This Master File has to be modified to remove the DATASET attribute and to enter useful FIELDNAMES. The following is an example of a modified Master File.
FILENAME=SALESREPS, SUFFIX=DFIX , $ SEGMENT=SALESREPS, SEGTYPE=S0, $ FIELDNAME=NAME , ALIAS= , USAGE=A18, ACTUAL=A18B, $ FIELDNAME=CITY , ALIAS= , USAGE=A10, ACTUAL=A10B, $ FIELDNAME=STATE , ALIAS= , USAGE=A2, ACTUAL=A2B, $ FIELDNAME=COUNTRY, ALIAS= , USAGE=A3, ACTUAL=A3B, $
The following is a WebFOCUS procedure example which reports against the passed comma-delimited data. Ensure that there is a FILEDEF statement in the procedure.
Notice that there is no path defined to the comma-delimited file and the file extension is "ftm" as the WebFocusRunFexExtended function passes the comma-delimited data to a temporary location in the WebFOCUS environment.
FILEDEF SALESREPS DISK SalesReps.ftm TABLE FILE SALESREPS PRINT NAME CITY STATE COUNTRY ON TABLE NOTOTAL END
The following is the Visual Basic .NET example used to report against the comma-delimited data passed in the WebFocusRunFexExtended function.
Dim wfs As New SelfServe.WebFocus Dim logon As New SelfServe.LogOnInfo Dim FexInfoIn As New SelfServe.FexInfo Dim InputInclude As New SelfServe.InputData Dim multiOutput As New SelfServe.MultiOutputFormat Dim retWF() As SelfServe.WebFocusReturn Dim newOutput As String Dim tempfile As String Dim csvfile As New System.IO.StreamReader("c:\SalesReps.csv") Dim csvString As String = csvfile.ReadToEnd() csvfile.Close() FexInfoIn.server = "EDASERVE" FexInfoIn.app = "BASEAPP" FexInfoIn.name = "SalesRepsCSV" multiOutput.format = SelfServe.MultiOutputType.original InputInclude.name = "SalesReps" InputInclude.text = csvString logon = wfs.WebFocusLogOn("RepUser", "RepPass", "", "") retWF = wfs.WebFocusRunFexExtended(logon, FexInfoIn, multiOutput, InputInclude) tempfile = "c:\temp\ReportCSV.htm" newOutput = retWF(0).output FileOpen(1, tempfile, OpenMode.Output) Print(1, newOutput) FileClose(1)
Note: SelfServe is the name of the Web Reference.
In the following example, a report called SalesRepsCSV from the BASEAPP application is run utilizing comma-delimited data which is read in from a file called SalesReps.csv. The output from the function is written to the ReportCSV.htm file in the c:\temp directory.
The following is the content of the SalesReps.csv file.
"Carole Fernandez ","Boston ","MA","USA" "Dave Wheelock ","Houston ","TX","USA" "Phil McRell ","Chicago ","IL","USA"
In order to create a report against the comma-delimited data, a Master File must first be created. This can be done by utilizing the Create Synonym utility in the WebFOCUS Server Console.
Right-click on Delimited Flat File in the configured adapters and select Create Synonym.
Enter the directory where the comma-delimited file exists in the Directory path. Also, enter the file name minus the extension in the File name text box and the file extension in the File extension text box for the comma-delimited file. Click the Select Files button.
Check the box next to the file name for which a Master File is to be created. Select the application where the Master File is to be put from the drop-down box. Enter the delimiter character in the Delimiter text box and the text enclosure character in the Enclosure textbox. Make Unique and Validate should also be checked in order to ensure that all FIELDNAMES within the Master File are unique. Click the Create Synonym button.
The following is the Master File created from the Create Synonym process using the SalesReps.csv file.
FILENAME=SALESREPS, SUFFIX=DFIX , DATASET=C:\SalesReps.csv, $ SEGMENT=SALESREPS, SEGTYPE=S0, $ FIELDNAME=FIELD_1, ALIAS= , USAGE=A18, ACTUAL=A18B, $ FIELDNAME=FIELD_2, ALIAS= , USAGE=A10, ACTUAL=A10B, $ FIELDNAME=FIELD_3, ALIAS= , USAGE=A2, ACTUAL=A2B, $ FIELDNAME=FIELD_4, ALIAS= , USAGE=A3, ACTUAL=A3B, $
This Master File has to be modified to remove the DATASET attribute and to enter useful FIELDNAMES. The following is an example of a modified Master File.
FILENAME=SALESREPS, SUFFIX=DFIX , $ SEGMENT=SALESREPS, SEGTYPE=S0, $ FIELDNAME=NAME , ALIAS= , USAGE=A18, ACTUAL=A18B, $ FIELDNAME=CITY , ALIAS= , USAGE=A10, ACTUAL=A10B, $ FIELDNAME=STATE , ALIAS= , USAGE=A2, ACTUAL=A2B, $ FIELDNAME=COUNTRY, ALIAS= , USAGE=A3, ACTUAL=A3B, $
The following is a WebFOCUS procedure example which reports against the passed comma-delimited data. Ensure that there is a FILEDEF statement in the procedure.
Notice that there is no path defined to the comma-delimited file and the file extension is "ftm" as the WebFocusRunFexExtended function passes the comma-delimited data to a temporary location in the WebFOCUS environment.
FILEDEF SALESREPS DISK SalesReps.ftm TABLE FILE SALESREPS PRINT NAME CITY STATE COUNTRY ON TABLE NOTOTAL END
The following is the Java example used to report against the comma-delimited data passed in the WebFocusRunFexExtended function.
try { WebFocus WFservice = new WebFocusLocator(); WebFocusSoap_PortType wfs = WFservice.getWebFocusSoap(); String myCSV="C:/SalesReps.csv"; BufferedReader inBuff = new BufferedReader(new FileReader(myCSV)); String newLine = System.getProperty("line.separator"); StringBuilder sb = new StringBuilder(); String line; while ((line = inBuff.readLine()) != null) { sb.append(line).append(newLine); } InputData InputInclude = new InputData(); InputInclude.setName("SalesReps"); InputInclude.setText(sb.toString());
FexInfo fexInfo = new FexInfo(); fexInfo.setName("SalesRepsCSV"); fexInfo.setApp("BASEAPP"); MultiOutputFormat multiOutput = new MultiOutputFormat(); multiOutput.setFormat(MultiOutputType.original); LogOnInfo logon = wfs.webFocusLogOn("RepUser","RepPass","",""); WebFocusReturn[] ret = wfs.webFocusRunFexExtended(logon,fexInfo, multiOutput,InputInclude); String newOutput=ret[0].getOutput(); File tempfile = null; tempfile = new File("c:\\temp\\ReportCSV.htm"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); out.println(newOutput); out.close(); } catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
Function Name: WebFocusRunFexExtendedDS
Purpose: To run a WebFOCUS Report that utilizes the .NET Dataset passed in the function and is able to resolve any links created in a Drill-Down report or Graph. The links can be resolved to an array of output or WebArchive (.mht) format.
Input:
Description |
Type |
---|---|
WebFOCUS cookie information. |
LogOnInfo |
WebFOCUS report run information. |
FexInfo |
Report Output Definition. |
MulitOutputFormat |
Input data to be used at run time. |
DataSet |
Output:
Description |
Type |
---|---|
Structure that contains the array of output from a WebFOCUS report. |
WebFocusReturn array |
In the following example, a .NET Dataset is populated from an adhoc WebFOCUS Procedure Code request. The Dataset is used as the data source for running a WebFOCUS report called PrintDataset from the IBISAMP application. The Dataset Name is used as the Table name in the WebFOCUS report. The output is returned in the format defined by the PrintDataset report which is HTML and written to the OutputDS.htm file in the c:\temp directory.
Dim wfs As New SelfServe.WebFocus Dim ret As New SelfServe.WebFocusReturn Dim logon As New SelfServe.LogOnInfo Dim FexInfoIn As New SelfServe.FexInfo Dim i As Integer FexInfoIn.adhocfex = "TABLE FILE CAR" + vbCrLf + _ "PRINT MODEL" + vbCrLf + _ "BY COUNTRY" + vbCrLf + _ "BY CAR" + vbCrLf + _ "ON TABLE PCHOLD FORMAT XML" + vbCrLf + _ "END" logon = wfs.WebFocusLogOn("RepUser", "RepPass", "", "") ret = wfs.WebFocusRunFex(logon, FexInfoIn) Dim Table1 As DataTable Table1 = New DataTable("CARFILE") Dim Country As DataColumn = New DataColumn("Country") Country.DataType = System.Type.GetType("System.String") Country.MaxLength = 10 Table1.Columns.Add(Country)
Dim Car As DataColumn = New DataColumn("Car") Car.DataType = System.Type.GetType("System.String") Car.MaxLength = 16 Table1.Columns.Add(Car)
Dim Model As DataColumn = New DataColumn("Model") Model.DataType = System.Type.GetType("System.String") Model.MaxLength = 24 Table1.Columns.Add(Model) For i = 0 To ret.values(0).Length - 1 Dim Row1 As DataRow Row1 = Table1.NewRow() Row1.Item("Country") = ret.values(0)(i) Row1.Item("Car") = ret.values(1)(i) Row1.Item("Model") = ret.values(2)(i) Table1.Rows.Add(Row1) Next i Dim ds As DataSet ds = New DataSet ds.DataSetName = "MYDATASET" ds.Namespace = "MYNAMESPACE" ds.Tables.Add(Table1) Dim retWF() As SelfServe.WebFocusReturn Dim fexIn As New SelfServe.FexInfo Dim multiOutput As New SelfServe.MultiOutputFormat Dim newOutput As String Dim tempfile As String fexIn.server = "EDASERVE" fexIn.app = "IBISAMP" fexIn.name = "PrintDataset" multiOutput.format = SelfServe.MultiOutputType.original retWF = wfs.WebFocusRunFexExtendedDS(logon, fexIn, multiOutput, ds) newOutput = retWF(0).output tempfile = "c:\temp\OutputDS" + "." + retWF(0).ext FileOpen(1, tempfile, OpenMode.Output) Print(1, newOutput) FileClose(1)
Note: SelfServe is the name of the Web Reference.
Function Name: WebFocusFexReflection
Purpose: To retrieve the parameters of a WebFOCUS report.
Input:
Description |
Type |
---|---|
WebFOCUS cookie information. |
LogOnInfo |
WebFOCUS reporting run information. |
FexInfo |
Output:
Description |
Type |
---|---|
Structure that contains information about running the WebFOCUS report. The parameters are retrieved into the ValuesArrayEntry structure that is a sub-structure of the FexInfo structure. |
FexInfo |
In the following example, the parameter information from a WebFOCUS report named CAR54 is written to the Parameters.txt file in the c:\temp directory.
Dim wfs As New SelfServe.WebFocus Dim logon As New SelfServe.LogOnInfo Dim fexinfoIn As New SelfServe.FexInfo Dim fexinfoOut As New SelfServe.FexInfo Dim newOutput As String = "" Dim tempfile As String Dim i As Integer fexinfoIn.server = "EDASERVE" fexinfoIn.app = "IBISAMP" fexinfoIn.name = "CAR54" logon = wfs.WebFocusLogOn("RepUser", "RepPass", "", "") fexinfoOut = wfs.WebFocusFexReflection(logon, fexinfoIn)
tempfile = "c:\temp\Parameters.txt" FileOpen(1, tempfile, OpenMode.Output) For i = 0 To fexinfoOut.IBIWS_arrayvalues.Length - 1 newOutput = fexinfoOut.IBIWS_arrayvalues(i).prompt + " " _ + fexinfoOut.IBIWS_arrayvalues(i).name + " " _ + fexinfoOut.IBIWS_arrayvalues(i).defaultVal PrintLine(1, newOutput) Next i FileClose(1)
Note: SelfServe is the name of the Web Reference.
In the following example, the parameter information from a WebFOCUS report named CAR54 is written to the Parameters.txt file in the c:\temp directory.
try { WebFocus WFservice = new WebFocusLocator(); WebFocusSoap_PortType wfs = WFservice.getWebFocusSoap(); FexInfo fexinfoIn = new FexInfo(); ValuesArrayEntry[] Values; fexinfoIn.setServer("EDASERVE"); fexinfoIn.setApp("IBISAMP"); fexinfoIn.setName("CAR54"); LogOnInfo logon = wfs.webFocusLogOn("RepUser","RepPass","",""); FexInfo fexinfoOut = wfs.webFocusFexReflection(logon,fexinfoIn); String newOutput = null; File tempfile = new File("c:\\temp\\Parameters.txt"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos);
Values = fexinfoOut.getIBIWS_arrayvalues(); for ( int i=0; i<Values.length; i++ ) { newOutput = Values[i].getPrompt() + " " + Values[i].getName() + " " + Values[i].getDefaultVal(); out.println(newOutput); } out.close(); } catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
Function Name: WebFocusLink
Purpose: To run the links brought back in a WebFOCUS report, such as drill-down information and information to obtain a graph created by a WebFOCUS report. If the URL is being captured within a program when you click a link within a WebFOCUS report, you should use the WebFocusDrill function instead.
Input:
Description |
Type |
---|---|
WebFOCUS cookie information. |
LogOnInfo |
LinkArrayEntry structure obtained in the WebFocusReturn structure. |
LinkArrayEntry |
Output:
Description |
Type |
---|---|
Structure containing the output from a WebFOCUS report. |
WebFocusReturn |
When you use the LinkArrayEntry structure for drill-down information, the array of links are brought back in pairs within the WebFocusReturn structure if the output format is HTML. The first array entry would have a type of urlstart and the second array entry would have a type of fexdrill. You can only pass link types of fexdrill as a parameter to WebFocusLink for a drill-down report.
In the following example, the output of the result of a drill-down report from a WebFOCUS report named CENTPL_ACTBUD is written to the Centpl_ActBud.htm file in the c:\temp directory. The first line of the report is used in the drill-down.
Dim wfs As New SelfServe.WebFocus Dim logon As New SelfServe.LogOnInfo Dim ret As New SelfServe.WebFocusReturn Dim retdrill As New SelfServe.WebFocusReturn Dim report As New SelfServe.FexInfo Dim newOutput As String = "" Dim tempfile As String report.server = "EDASERVE" report.app = "FML_DEMO_2" report.name = "CENTPL_ACTBUD" logon = wfs.WebFocusLogOn("RepUser", "RepPass", "", "") ret = wfs.WebFocusRunFex(logon, report) retdrill = wfs.WebFocusLink(logon, ret.links(3)) newOutput = retdrill.output tempfile = "c:\temp\Centpl_ActBud.htm" FileOpen(1, tempfile, OpenMode.Output) Print(1, newOutput) FileClose(1)
Note: SelfServe is the name of the Web Reference.
In the following example, the output of the result of a drill-down report from a WebFOCUS report named CENTPL_ACTBUD is written to the Centpl_ActBud.htm file in the c:\temp directory. The first line of the report is used in the drill-down.
try { WebFocus WFservice = new WebFocusLocator(); WebFocusSoap_PortType wfs = WFservice.getWebFocusSoap(); LinkArrayEntry[] Links; FexInfo report = new FexInfo(); report.setServer("EDASERVE"); report.setApp("FML_DEMO_2"); report.setName("CENTPL_ACTBUD"); LogOnInfo logon = wfs.webFocusLogOn("RepUser","RepPass","",""); WebFocusReturn ret = wfs.webFocusRunFex(logon,report); Links = ret.getLinks(); WebFocusReturn retdrill = wfs.webFocusLink(logon,Links[3]); String newOutput=retdrill.getOutput(); File tempfile = new File("c:\\temp\\Centpl_actBud.htm"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); out.println(newOutput); out.close(); } catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
In the following example, the output of a WebFOCUS report named CarGraph that produces a graph is written to the CarGraph.htm file in the c:\temp directory.
'The following line must be included before the Form Class Imports System.IO Dim wfs As New SelfServe.WebFocus Dim logon As New SelfServe.LogOnInfo Dim ret As New SelfServe.WebFocusReturn Dim retdrill As New SelfServe.WebFocusReturn Dim report As New SelfServe.FexInfo Dim newOutput As String = "" Dim tempfile As String Dim lastlink As Integer = 0 Dim link As String Dim outfile As String report.server = "EDASERVE" report.app = "IBISAMP" report.name = "CarGraph" logon = wfs.WebFocusLogOn("RepUser", "RepPass", "", "") ret = wfs.WebFocusRunFex(logon, report) link = ret.links(0).link retdrill = wfs.WebFocusLink(logon, ret.links(0))
If retdrill.mime = "image/png" Then outfile = "c:\temp\CarGraph.png" Dim fs As FileStream = New FileStream(outfile, FileMode.OpenOrCreate) Dim w As BinaryWriter = New BinaryWriter(fs) w.Write(retdrill.binaryData, 0, retdrill.binaryData.Length) fs.Close() ElseIf retdrill.mime = "image/gif" Then outfile = "c:\temp\CarGraph.gif" Dim fs As FileStream = New FileStream(outfile, FileMode.OpenOrCreate) Dim w As BinaryWriter = New BinaryWriter(fs) w.Write(retdrill.binaryData, 0, retdrill.binaryData.Length) fs.Close() ElseIf retdrill.mime = "image/jpeg" Then outfile = "c:\temp\CarGraph.jpg" Dim fs As FileStream = New FileStream(outfile, FileMode.OpenOrCreate) Dim w As BinaryWriter = New BinaryWriter(fs) w.Write(retdrill.binaryData, 0, retdrill.binaryData.Length) fs.Close()
ElseIf retdrill.mime = "image/svg+xml" Then outfile = "c:\temp\CarGraph.svg" Dim fs As FileStream = New FileStream(outfile, FileMode.OpenOrCreate) Dim w As BinaryWriter = New BinaryWriter(fs) w.Write(retdrill.output, 0, retdrill.output.Length) fs.Close() End If newOutput = newOutput + Mid(ret.output, 1, ret.links(0).position) newOutput = newOutput + outfile lastlink = ret.links(0).position + link.Length newOutput = newOutput + Mid(ret.output, lastlink + 1) tempfile = "c:\temp\CarGraph.htm" FileOpen(1, tempfile, OpenMode.Output) Print(1, newOutput) FileClose(1)
Note: SelfServe is the name of the Web Reference.
In the following example, the output of a WebFOCUS report named CarGraph that produces a graph is written to the CarGraph.htm file in the c:\temp directory.
try { WebFocus WFservice = new WebFocusLocator(); WebFocusSoap_PortType wfs = WFservice.getWebFocusSoap(); File outfile = new File("c:\\temp\\CarGraph.png"); LinkArrayEntry[] Links; FexInfo report = new FexInfo(); report.setServer("EDASERVE"); report.setApp("IBISAMP"); report.setName("CarGraph"); LogOnInfo logon = wfs.webFocusLogOn("RepUser","RepPass","",""); WebFocusReturn ret = wfs.webFocusRunFex(logon,report); Links = ret.getLinks(); String link = Links[0].getLink(); WebFocusReturn retdrill = wfs.webFocusLink(logon,Links[0]); if (retdrill.getMime().equals ("image/png")) { byte[] outbytes = retdrill.getBinaryData(); outfile = new File("c:\\temp\\CarGraph.png"); FileOutputStream fs = new FileOutputStream(outfile); fs.write(outbytes); fs.close(); }
else { if (retdrill.getMime().equals ("image/gif")) { byte[] outbytes = retdrill.getBinaryData(); outfile = new File("c:\\temp\\CarGraph.gif"); FileOutputStream fs = new FileOutputStream(outfile); fs.write(outbytes); fs.close(); } else { if (retdrill.getMime().equals ("image/jpeg")) { byte[] outbytes = retdrill.getBinaryData(); outfile = new File("c:\\temp\\CarGraph.jpg"); FileOutputStream fs = new FileOutputStream(outfile); fs.write(outbytes); fs.close(); } else { if (retdrill.getMime().equals ("image/svg+xml")) { String outstring = retdrill.getOutput(); outfile = new File("c:\\temp\\CarGraph.svg"); FileOutputStream fosg = new FileOutputStream(outfile); PrintWriter fs = new PrintWriter(fosg); fs.println(outstring); fs.close(); } else { } } } }
String newOutput = ""; newOutput=newOutput+ret.getOutput().substring(0, Links[0].getPosition() - 1); newOutput=newOutput+outfile; int lastlink = Links[0].getPosition()+ link.length(); newOutput=newOutput+ret.getOutput().substring(lastlink+1); File tempfile = new File("c:\\temp\\CarGraph.htm"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); out.println(newOutput); out.close(); } catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
Function Name: WebFocusLinkExtended
Purpose: To resolve the links returned in the WebFocusReturn structure. These links can be from a Drill-Down report or Graph. The links can be resolved to an array of output or WebArchive (.mht) format.
Input:
Description |
Type |
---|---|
WebFOCUS cookie information. |
LogOnInfo |
Link ArrayEntry structure obtained in the WebFocusReturn structure |
LinkArrayEntry |
Report Output Definition. |
MulitOutputFormat |
Output:
Description |
Type |
---|---|
Structure that contains the array of output from a WebFOCUS report. |
WebFocusReturn array |
In the following example, a report called CENTPL_ACTBUD from the FML_DEMO_2 application is run. The 3rd entry in the LinkArrayEntry structure within the WebFocusReturn structure is passed to the function. One level of Drill-Downs below the link identified in the entry of the LinkArrayEntry structure is resolved with the output returned in WebArchive format. The output from the function is written to the OutputLink.mht file in the c:\temp directory.
Dim wfs As New SelfServe.WebFocus Dim logon As New SelfServe.LogOnInfo Dim FexInfoIn As New SelfServe.FexInfo Dim InputInclude As New SelfServe.InputData Dim multiOutput As New SelfServe.MultiOutputFormat Dim ret As SelfServe.WebFocusReturn Dim retWF() As SelfServe.WebFocusReturn Dim newOutput As String Dim tempfile As String FexInfoIn.server = "EDASERVE" FexInfoIn.app = "FML_DEMO_2" FexInfoIn.name = "CENTPL_ACTBUD" logon = wfs.WebFocusLogOn("RepUser", "RepPass", "", "") ret = wfs.WebFocusRunFex(logon, FexInfoIn) multiOutput.format = SelfServe.MultiOutputType.webarchive multiOutput.levels = 1 multiOutput.dowfdrills = True retWF = wfs.WebFocusLinkExtended(logon, ret.links(3), multiOutput) tempfile = "c:\temp\OutputLink.mht" newOutput = retWF(0).output FileOpen(1, tempfile, OpenMode.Output) Print(1, newOutput) FileClose(1)
Note: SelfServe is the name of the Web Reference.
In the following example, a report called CENTPL_ACTBUD from the FML_DEMO_2 application is run. The 3rd entry in the LinkArrayEntry structure within the WebFocusReturn structure is passed to the function. One level of Drill-Downs below the link identified in the entry of the LinkArrayEntry structure is resolved with the output returned in WebArchive format. The output from the function is written to the OutputLink.mht file in the c:\temp directory.
try { WebFocus WFservice = new WebFocusLocator(); WebFocusSoap_PortType wfs = WFservice.getWebFocusSoap(); FexInfo FexInfoIn = new FexInfo(); FexInfoIn.setServer("EDASERVE"); FexInfoIn.setApp("FML_DEMO_2"); FexInfoIn.setName("CENTPL_ACTBUD"); LogOnInfo logon = wfs.webFocusLogOn("RepUser","RepPass","",""); WebFocusReturn ret = wfs.webFocusRunFex(logon,FexInfoIn); LinkArrayEntry[] Links = ret.getLinks(); MultiOutputFormat multiOutput = new MultiOutputFormat(); multiOutput.setFormat(MultiOutputType.webarchive); multiOutput.setLevels(1); multiOutput.setDowfdrills(true); WebFocusReturn[] retWF = wfs.webFocusLinkExtended(logon,Links[3],multiOutput);
String newOutput=retWF[0].getOutput(); File tempfile = new File("c:\\temp\\OutputLink.mht"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); out.println(newOutput); out.close(); } catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
Function Name: WebFocusDrill
Purpose: To run a drill-down WebFOCUS report when the URL is captured within a program if a link within a WebFOCUS report is clicked on.
Input:
Description |
Type |
---|---|
WebFOCUS cookie information. |
LogOnInfo |
The edited link captured within a program when you have clicked a link in a WebFOCUS report. You must remove the http:// and the machine name or TCP/IP address from the URL before you pass it. When you use Managed Reporting, you must either associate the WebFOCUS report with a specific application, or you must set SET BASEURL (for example, to SET BASEURL = 'http://localhost') in the WebFOCUS report. This will only work if the output type of the WebFOCUS report is HTML. |
String |
The following example shows an associated WebFOCUS report that resides in Managed Reporting with a specific application.
Output:
Description |
Type |
---|---|
Structure that contains the output from a WebFOCUS report. |
WebFocusReturn |
In the following example, the output of a drill-down report from a WebFOCUS report named CENTPL_ACTBUD is written to the Centpl_ActBud.htm file in the c:\temp directory.The example begins with the result URL that is clicked on.
Dim wfs As New SelfServe.WebFocus Dim logon As New SelfServe.LogOnInfo Dim ret As New SelfServe.WebFocusReturn Dim retdrill As New SelfServe.WebFocusReturn Dim report As New SelfServe.FexInfo Dim newOutput As String = "" Dim tempfile As String Dim URL As String Dim newURL As String report.server = "EDASERVE" report.app = "FML_DEMO_2" report.name = "CENTPL_ACTBUD" logon = wfs.WebFocusLogOn("RepUser", "RepPass", "", "") ret = wfs.WebFocusRunFex(logon, report) URL = "http://localhost/webservice?IBIF_webapp=/ibi_apps&IBIC_server=EDASERVE&I BIAPP_app=fml_demo_2&IBIF_ex=CENTPL_ACTBUD_DRILL&CLICKED_ON=&ACCNT=1000&A CCNT_LIT=Profit%20Before%20Tax&SEL_PERIOD=2002/06" newURL = Replace(URL, "http://localhost", "") retdrill = wfs.WebFocusDrill(logon, newURL) newOutput = retdrill.output tempfile = "c:\temp\Centpl_ActBud.htm" FileOpen(1, tempfile, OpenMode.Output) Print(1, newOutput) FileClose(1)
Note: SelfServe is the name of the Web Reference.
In the following example, the output of a drill-down report from a WebFOCUS report named CENTPL_ACTBUD is written to the Centpl_ActBud.htm file in the c:\temp directory.The example begins with the result URL that is clicked on.
try { WebFocus WFservice = new WebFocusLocator(); WebFocusSoap_PortType wfs = WFservice.getWebFocusSoap(); String URL; String newURL; FexInfo report = new FexInfo(); report.setServer("EDASERVE"); report.setApp("FML_DEMO_2"); report.setName("CENTPL_ACTBUD"); LogOnInfo logon = wfs.webFocusLogOn("RepUser","RepPass","",""); WebFocusReturn ret = wfs.webFocusRunFex(logon,report); URL = "http://localhost/webservice?IBIF_webapp=/ibi_apps&IBIC_server=EDASERVE&I BIAPP_app=fml_demo_2&IBIF_ex=CENTPL_ACTBUD_DRILL&CLICKED_ON=&ACCNT=1000&A CCNT_LIT=Profit%20Before%20Tax&SEL_PERIOD=2002/06"; newURL = URL.substring(16);
WebFocusReturn retdrill = wfs.webFocusDrill(logon,newURL); String newOutput=retdrill.getOutput(); File tempfile = new File("c:\\temp\\Centpl_actBud.htm"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); out.println(newOutput); out.close(); } catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
Function Name: WebFocusDrillExtended
Purpose: To run a drill-down from a WebFOCUS report when the URL is captured within a program if a link within a WebFOCUS report is clicked on. It also can resolve any links below the clicked on link. These links can be from a Drill-Down report or Graph. The links can be resolved to an array of output or WebArchive (.mht) format.
Input:
Description |
Type |
---|---|
WebFOCUS cookie information. |
LogOnInfo |
The edited link captured within a program when you have clicked a link in a WebFOCUS report. You must remove the http:// and the machine name or TCP/IP address from the URL before you pass it. When you use Managed Reporting, you must either associate the WebFOCUS report with a specific application, or you must set SET BASEURL (for example, to SET BASEURL = 'http://localhost') in the WebFOCUS report. This will only work if the output type of the WebFOCUS report is HTML. |
String |
Report Output Definition. |
MulitOutputFormat |
The following example shows an associated WebFOCUS report that resides in Managed Reporting with a specific application.
Output:
Description |
Type |
---|---|
Structure that contains the array of output from a WebFOCUS report. |
WebFocusReturn array |
In the following example, a link from a WebFOCUS report is run. One level of Drill-Downs below the link is resolved with the output returned in WebArchive format. The output from the function is written to the OutputDrill.mht file in the c:\temp directory.
Dim wfs As New SelfServe.WebFocus Dim logon As New SelfServe.LogOnInfo Dim multiOutput As New SelfServe.MultiOutputFormat Dim retWF() As SelfServe.WebFocusReturn Dim newOutput As String Dim tempfile As String Dim URL As String Dim newURL As String multiOutput.format = SelfServe.MultiOutputType.webarchive multiOutput.levels = 1 multiOutput.dowfdrills = True URL = "http://localhost/webservice?IBIF_webapp=/ibi_apps&IBIC_server=EDASERVE &IBIAPP_app=fml_demo_2&IBIF_ex=CENTPL_ACTBUD_DRILL&CLICKED_ON=&ACCNT=1000 &ACCNT_LIT=Profit%20Before%20Tax&SEL_PERIOD=2002/06" newURL = Replace(URL, "http://localhost", "") logon = wfs.WebFocusLogOn("RepUser", "RepPass", "", "") retWF = wfs.WebFocusDrillExtended(logon, newURL, multiOutput) tempfile = "c:\temp\OutputDrill.mht" newOutput = retWF(0).output FileOpen(1, tempfile, OpenMode.Output) Print(1, newOutput) FileClose(1)
Note: SelfServe is the name of the Web Reference.
In the following example, a link from a WebFOCUS report is run. One level of Drill-Downs below the link is resolved with the output returned in WebArchive format. The output from the function is written to the OutputDrill.mht file in the c:\temp directory.
try { WebFocus WFservice = new WebFocusLocator(); WebFocusSoap_PortType wfs = WFservice.getWebFocusSoap(); MultiOutputFormat multiOutput = new MultiOutputFormat(); multiOutput.setFormat(MultiOutputType.webarchive); multiOutput.setLevels(1); multiOutput.setDowfdrills(true); String URL = "http://localhost/webservice?IBIF_webapp=/ibi_apps&IBIC_server=EDASERVE&I BIAPP_app=fml_demo_2&IBIF_ex=CENTPL_ACTBUD_DRILL&CLICKED_ON=&ACCNT=1000&A CCNT_LIT=Profit%20Before%20Tax&SEL_PERIOD=2002/06"; String newURL = URL.substring(16); LogOnInfo logon = wfs.webFocusLogOn("RepUser","RepPass","",""); WebFocusReturn[] retWF = wfs.webFocusDrillExtended(logon,newURL,multiOutput); String newOutput=retWF[0].getOutput(); File tempfile = new File("c:\\temp\\OutputDrill.mht"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); out.println(newOutput); out.close(); } catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
Function Name: WebFocusListServers
Purpose: To retrieve a list of configured WebFOCUS Reporting Servers.
Input:
Description |
Type |
---|---|
WebFOCUS cookie information. |
LogOnInfo |
Output:
Description |
Type |
---|---|
Structure that contains information about the configured WebFOCUS Reporting Servers. The list of server information is retrieved into the serversArray structure that is a sub-structure of the ServerInfo structure. |
ServerInfo |
In the following example, the WebFOCUS Reporting Server information is written to the Servers.txt file in the c:\temp directory.
Dim wfs As New SelfServe.WebFocus Dim logon As New SelfServe.LogOnInfo Dim serversOut As New SelfServe.ServerInfo Dim newOutput As String = "" Dim tempfile As String Dim i As Integer logon = wfs.WebFocusLogOn("RepUser", "RepPass", "", "") serversOut = wfs.WebFocusListServers(logon) tempfile = "c:\temp\Servers.txt" FileOpen(1, tempfile, OpenMode.Output) For i = 0 To serversOut.servers.Length - 1 newOutput = serversOut.servers(i).handle + " " _ + serversOut.servers(i).class + "" _ + serversOut.servers(i).protocol PrintLine(1, newOutput) Next i FileClose(1)
Note: SelfServe is the name of the Web Reference.
In the following example, the WebFOCUS Reporting Server information is written to the Servers.txt file in the c:\temp directory.
try { WebFocus WFservice = new WebFocusLocator(); WebFocusSoap_PortType wfs = WFservice.getWebFocusSoap(); EdanodeObject[] Servers; LogOnInfo logon = wfs.webFocusLogOn("RepUser","RepPass","",""); ServerInfo serversOut = wfs.webFocusListServers(logon); String newOutput = null; File tempfile = new File("c:\\temp\\Servers.txt"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); Servers = serversOut.getServers(); for ( int i=0; i<Servers.length; i++ ) { newOutput = Servers[i].getHandle() + " " + Servers[i].get_class() + " " + Servers[i].getProtocol(); out.println(newOutput); } out.close(); } catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
Function Name: WebFocusListApps
Purpose: To retrieve a list of applications for a WebFOCUS Reporting Server.
Input:
Description |
Type |
---|---|
WebFOCUS cookie information. |
LogOnInfo |
WebFOCUS Reporting Server name. |
String |
Output:
Description |
Type |
---|---|
Structure that contains the output for WebFOCUS reports and certain WebFOCUS functions. The list of applications is returned to the values array of WebFocusReturn. values(0) contains an array of application names. values(1) contains an array of the last update date for each application (DD/MM/YYYY). values(2) contains an array of the last update time for each application (HH.MM.SS). |
WebFocusReturn |
In the following example, the list of application information for a WebFOCUS Reporting Server named EDASERVE is written to the Applications.txt file in the c:\temp directory.
Dim wfs As New SelfServe.WebFocus Dim logon As New SelfServe.LogOnInfo Dim ret As New SelfServe.WebFocusReturn Dim newOutput As String = "" Dim tempfile As String Dim i As Integer logon = wfs.WebFocusLogOn("RepUser", "RepPass", "", "") ret = wfs.WebFocusListApps(logon, "EDASERVE") tempfile = "c:\temp\Applications.txt" FileOpen(1, tempfile, OpenMode.Output) For i = 0 To ret.values(0).Length - 1 newOutput = ret.values(0)(i) + " " _ + ret.values(1)(i) + " " _ + ret.values(2)(i) PrintLine(1, newOutput) Next i FileClose(1)
Note: SelfServe is the name of the Web Reference.
In the following example, the list of application information for a WebFOCUS Reporting Server named EDASERVE is written to the Applications.txt file in the c:\temp directory.
try { WebFocus WFservice = new WebFocusLocator(); WebFocusSoap_PortType wfs = WFservice.getWebFocusSoap(); String[][] StringArray; LogOnInfo logon = wfs.webFocusLogOn("RepUser","RepPass","",""); WebFocusReturn ret = wfs.webFocusListApps(logon,"EDASERVE"); String newOutput = null; File tempfile = new File("c:\\temp\\Applications.txt"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new Print Writer(fos); StringArray = ret.getValues(); for ( int i=0; i<StringArray[0].length;i++ ) { newOutput = StringArray[0][i]+"" + StringArray[1][i]+"" + StringArray[2][i]; out.println(newOutput); } out.close(); } catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
Function Name: WebFocusListFexs
Purpose: To retrieve a list of files within a particular application categorized by file type (for example, FOCEXEC, MASTER, HTML).
Input:
Description |
Type |
---|---|
WebFOCUS cookie information. |
LogOnInfo |
WebFOCUS Reporting Server name. |
String |
Application name. |
String |
Output:
Description |
Type |
---|---|
Structure that contains output for WebFOCUS reports and certain WebFOCUS functions. The list of files is returned to the values array of WebFocusReturn. values(0) contains an array of file types for each file (for example, FOCEXEC, GIF, HTML, MASTER, FOCSTYLE, OTHER). values(1) contains an array of the file name for each file (for example, abc.fex, abc.gif, abc.htm, abc.mas, abc.sty, and abc.foc). values(2) contains an array of the file extension for each file (for example, FEX, GIF, HTM, MAS, STY, FOC, CSS, JS). values(3) contains an array of the last update date for each file (DD/MM/YYYY). values(4) contains an array of the last update time for each file (HH.MM.SS). values(5) contains an array of the last update for each file in milliseconds since January 1, 1970. values(6) contains an array of file size in bytes for each file. |
WebFocusReturn |
In the following example, the list of file information for an application named ibinccen is written to the Files.txt file in the c:\temp directory.
Dim wfs As New SelfServe.WebFocus Dim logon As New SelfServe.LogOnInfo Dim ret As New SelfServe.WebFocusReturn Dim newOutput As String = "" Dim tempfile As String Dim i As Integer logon = wfs.WebFocusLogOn("RepUser", "RepPass", "", "") ret = wfs.WebFocusListFexs(logon, "EDASERVE", "IBINCCEN") tempfile = "c:\temp\Files.txt" FileOpen(1, tempfile, OpenMode.Output) For i = 0 To ret.values(0).Length - 1 newOutput = ret.values(0)(i) + " " _ + ret.values(1)(i) + " " _ + ret.values(2)(i) + " " _ + ret.values(3)(i) + " " _ + ret.values(4)(i) + " " _ + ret.values(5)(i) + " " _ + ret.values(6)(i) PrintLine(1, newOutput) Next i FileClose(1)
Note: SelfServe is the name of the Web Reference.
In the following example, the list of file information for an application named ibinccen is written to the Files.txt file in the c:\temp directory.
try { WebFocus WFservice = new WebFocusLocator(); WebFocusSoap_PortType wfs = WFservice.getWebFocusSoap(); String[][] StringArray; LogOnInfo = wfs.webFocusLogOn("RepUser","RepPass","",""); WebFocusReturn ret = wfs.webFocusListFexs(logon,"EDASERVE","IBINCCEN"); String newOutput = null; File tempfile = newfile("c:\\temp\\Files.txt"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new Print Writer(fos); StringArray = ret.getValues(); for ( int i=0; i<StringArray[0].length; i++ ) { newOutput = StringArray[0][i]+"" +StringArray[1][i]+"" +StringArray[2][i]+"" +StringArray[3][i]+"" +StringArray[4][i]+"" +StringArray[5][i]+"" +StringArray[6][i]; out.println(newOutput); } out.close(); } catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
Function Name: WebFocusDBInfo
Purpose: To retrieve a list of available tables.
Input:
Description |
Type |
---|---|
WebFOCUS cookie information. |
LogOnInfo |
Output:
Description |
Type |
---|---|
Structure that contains table information. The list of table information is retrieved into the DBInfoEntry structure that is a sub-structure of the DBInfo structure. |
DBInfo |
In the following example, the list of table information is written to the Tables.txt file in the c:\temp directory.
Dim wfs As New SelfServe.WebFocus Dim logon As New SelfServe.LogOnInfo Dim dbret As New SelfServe.DBInfo Dim newOutput As String = "" Dim tempfile As String Dim i As Integer logon = wfs.WebFocusLogOn("RepUser", "RepPass", "", "") dbret = wfs.WebFocusDBInfo(logon) tempfile = "c:\temp\Tables.txt" FileOpen(1, tempfile, OpenMode.Output) For i = 0 To dbret.db.Length - 1 newOutput = dbret.db(i).name + " " _ + dbret.db(i).tbtype + " " _ + dbret.db(i).remarks PrintLine(1, newOutput) Next i FileClose(1)
Note: SelfServe is the name of the Web Reference.
In the following example, the list of table information is written to the Tables.txt file in the c:\temp directory.
try { WebFocus WFservice = new WebFocusLocator(); WebFocusSoap_PortType wfs = WFservice.getWebFocusSoap(); DBInfoEntry[] Tables; LogOnInfo logon = wfs.webFocusLogOn("RepUser","RepPass","",""); DBInfo dbret = wfs.webFocusDBInfo(logon); String newOutput = null; File tempfile = new File("c:\\temp\\Tables.txt"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); Tables = dbret.getDb(); for ( int i=0; i<Tables.length; i++ ) { newOutput = Tables[i].getName() + " " + Tables[i].getTbtype() + " " + Tables[i].getRemarks(); out.println(newOutput); } out.close(); } catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
Function Name: WebFocusMasterInfo
Purpose: To list Master File information for a particular table.
Input:
Description |
Type |
---|---|
WebFOCUS cookie information. |
LogOnInfo |
Table name. |
String |
Output:
Description |
Type |
---|---|
Structure that contains Master File information. The list of Master File information is retrieved into the MasterInfoEntry structure that is a sub-structure of the MasterInfo structure. |
MasterInfo |
In the following example, the Master File information for table CENTSTMT is written to the Master.txt file in the c:\temp directory.
Dim wfs As New SelfServe.WebFocus Dim logon As New SelfServe.LogOnInfo Dim masret As New SelfServe.MasterInfo Dim newOutput As String = "" Dim tempfile As String Dim i As Integer logon = wfs.WebFocusLogOn("RepUser", "RepPass", "", "") masret = wfs.WebFocusMasterInfo(logon, "CENTSTMT") tempfile = "c:\temp\Master.txt" FileOpen(1, tempfile, OpenMode.Output) For i = 0 To masret.fields.Length - 1 newOutput = masret.fields(i).name + " " _ + masret.fields(i).alias + " " _ + masret.fields(i).title + " " _ + masret.fields(i).remarks + " " _ + masret.fields(i).usage PrintLine(1, newOutput) Next i FileClose(1)
Note: SelfServe is the name of the Web Reference.
In the following example, the Master File information for table CENTSTMT is written to the Master.txt file in the c:\temp directory.
try { WebFocus WFservice = new WebFocusLocator(); WebFocusSoap_PortType wfs = WFservice.getWebFocusSoap(); MasterInfoEntry[] Fields; LogOnInfo logon = wfs.webFocusLogOn("RepUser","RepPass","",""); MasterInfo masret = wfs.webFocusMasterInfo(logon,"CENTSTMT"); String newOutput = null; File tempfile = new File("c:\\temp\\Master.txt"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); Fields = masret.getFields(); for ( int i=0; i<Fields.length; i++ ) { newOutput = Fields[i].getName() + " " + Fields[i].getAlias() + " " + Fields[i].getTitle() + " " + Fields[i].getRemarks() + " " + Fields[i].getUsage(); out.println(newOutput); } out.close(); } catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
Function Name: WebFocusSchemaInfo
Purpose: To retrieve the Master File information for a Schema.
Input:
Description |
Type |
---|---|
WebFOCUS cookie information. |
LogOnInfo |
Input data to be used at run time. |
InputData |
Output:
Description |
Type |
---|---|
Structure that contains Master File information. The list of Master File information is retrieved into the MasterInfoEntry structure that is a sub-structure of the MasterInfo structure. |
MasterInfo |
In the following example, a schema called rss20.xsd is read and used as input to the WebFocusSchemaInfo function. The function reads the schema and outputs Master File information to the Master.txt file in the c:\temp directory.
Dim wfs As New SelfServe.WebFocus Dim logon As New SelfServe.LogOnInfo Dim InputInclude As New SelfServe.InputData Dim masret As SelfServe.MasterInfo Dim newOutput As String Dim tempfile As String Dim i As Integer Dim xmlData As New System.Xml.XmlDocument Dim xmlParm As System.Xml.XmlElement xmlData.Load("d:\rss20.xsd") xmlParm = xmlData.DocumentElement InputInclude.name = "rss20" InputInclude.schema = xmlParm logon = wfs.WebFocusLogOn("RepUser", "RepPass", "", "") masret = wfs.WebFocusSchemaInfo(logon, InputInclude) tempfile = "c:\temp\Master.txt" FileOpen(1, tempfile, OpenMode.Output) For i = 0 To masret.fields.Length - 1 newOutput = masret.fields(i).name + " " _ + masret.fields(i).usage + " " _ + masret.fields(i).tbtype PrintLine(1, newOutput) Next i FileClose(1)
Note: SelfServe is the name of the Web Reference.
In the following example, a schema called rss20.xsd is read and used as input to the WebFocusSchemaInfo function. The function reads the schema and outputs Master File information to the Master.txt file in the c:\temp directory.
try { WebFocus WFservice = new WebFocusLocator(); WebFocusSoap wfs = WFservice.getWebFocusSoap(); MasterInfoEntry[] Fields; String myXSD="D:/rss20.xsd"; File x = new File(myXSD); FileInputStream f = new FileInputStream(x); SOAPBodyElement s = new SOAPBodyElement(f); MessageElement[] m = new MessageElement[1]; m[0] = s; InputData InputInclude = new InputData(); InputInclude.setName("rss20"); InputDataSchema mySchema = new InputDataSchema(); mySchema.set_any(m); InputInclude.setSchema(mySchema); LogOnInfo logon = wfs.webFocusLogOn("RepUser","RepPass","",""); MasterInfo masret = wfs.webFocusSchemaInfo(logon,InputInclude);
String newOutput = null; File tempfile = new File("c:\\temp\\Master.txt"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); Fields = masret.getFields(); for ( int i=0; i<Fields.length; i++ ) { newOutput = Fields[i].getName() + " " + Fields[i].getUsage()+ " " + Fields[i].getTbtype(); out.println(newOutput); } out.close(); } catch (Throwable t) { system.err.println(t); t.printStackTrace(); System.exit(1); }
Function Name: WebFocusFieldValues
Purpose: To retrieve a list of values for a particular column within a table.
Input:
Description |
Type |
---|---|
WebFOCUS cookie information. |
LogOnInfo |
Table name. |
String |
WebFOCUS code that is used as a preprocess before the values are retrieved, such as, JOIN, DEFINE, TABLE, and SET. It is important that each line of WebFOCUS code end with a CR and LF character with the exception of the last line. |
String |
Column name or virtual field name. |
String |
Requested format of returned values (for example, A15). |
String |
Selection criteria (for example, IF DEALER_COST GT 5000). |
String |
Output:
Description |
Type |
---|---|
Structure that contains output for WebFOCUS reports and certain WebFOCUS functions. The list of values is returned to the values array of WebFocusReturn. values(0) contains an array of values. |
WebFocusReturn |
In the following example, the list of values for the column COUNTRY within the CAR table is written to the Values.txt file in the c:\temp directory. COUNTRYN has been defined as the COUNTRY column name surrounded by brackets. The values have been reformatted to A15 from the original size of A12. Only values where the Dealer Cost is greater than 5000 will be selected.
Dim wfs As New SelfServe.WebFocus Dim logon As New SelfServe.LogOnInfo Dim ret As New SelfServe.WebFocusReturn Dim newOutput As String = "" Dim tempfile As String Dim i As Integer Dim FocCode As String Dim FC1 As String Dim FC2 As String Dim FC3 As String Dim CRLF As String Dim Selct As String
CRLF = vbCrLf FC1 = "DEFINE FILE CAR" FC2 = "COUNTRYN/A12 = '(' | COUNTRY | ')';" FC3 = "END" FocCode = FC1 + CRLF + FC2 + CRLF + FC3 Selct = "IF DEALER_COST GT 5000" logon = wfs.WebFocusLogOn("RepUser", "RepPass", "", "") ret = wfs.WebFocusFieldValues(logon, "CAR", FocCode, "COUNTRYN", "A15", Selct) tempfile = "c:\temp\Values.txt" FileOpen(1, tempfile, OpenMode.Output) For i = 0 To ret.values(0).Length - 1 newOutput = ret.values(0)(i) PrintLine(1, newOutput) Next i FileClose(1)
Note: SelfServe is the name of the Web Reference.
In the following example, the list of values for the column COUNTRY within the CAR table is written to the Values.txt file in the c:\temp directory. COUNTRYN has been defined as the COUNTRY column name surrounded by brackets. The values have been reformatted to A15 from the original size of A12. Only values where the Dealer Cost is greater than 5000 will be selected.
try { WebFocus WFservice = new WebFocusLocator(); WebFocusSoap_PortType wfs = WFservice.getWebFocusSoap(); WebFocusReturn ret; String[][] StringArray; String CRLF = System.getProperty("line.separator"); String FC1 = "DEFINE FILE CAR"; String FC2 = "COUNTRYN/A12 = '(' | COUNTRY | ')';"; String FC3 = "END"; String FocCode = FC1 + CRLF + FC2 + CRLF + FC3; String Selct = "IF DEALER_COST GT 5000"; LogOnInfo logon = wfs.webFocusLogOn("RepUser","RepPass","",""); ret = wfs.webFocusFieldValues(logon,"CAR",FocCode,"COUNTRYN","A15",Selct); String newOutput = null; File tempfile = new File("c:\\temp\\Values.txt"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos);
StringArray = ret.getValues(); for ( int i=0; i<StringArray[0].length; i++ ) { newOutput = StringArray[0][i]; out.println(newOutput); } out.close(); } catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
Function Name: WebFocusGetFexText
Purpose: To retrieve the WebFOCUS code for a WebFOCUS Report.
Input:
Description |
Type |
---|---|
WebFOCUS cookie information. |
LogOnInfo |
WebFOCUS report run information. |
FexInfo |
Output:
Description |
Type |
---|---|
Structure that contains output for WebFOCUS reports and certain WebFOCUS functions. |
WebFocusReturn |
In the following example, the WebFOCUS code for the WebFOCUS report named CAR54 in the IBISAMP application is retrieved and written to the Car54.fex file in the c:\temp directory.
Dim wfs As New SelfServe.WebFocus Dim logon As New SelfServe.LogOnInfo Dim ret As New SelfServe.WebFocusReturn Dim report As New SelfServe.FexInfo Dim newOutput As String = "" Dim tempfile As String report.server = "EDASERVE" report.app = "IBISAMP" report.name = "CAR54" logon = wfs.WebFocusLogOn("RepUser", "RepPass", "", "") ret = wfs.WebFocusGetFexText(logon, report) newOutput = ret.output tempfile = "c:\temp\Car54.fex" FileOpen(1, tempfile, OpenMode.Output) Print(1, newOutput) FileClose(1)
Note: SelfServe is the name of the Web Reference.
In the following example, the WebFOCUS code for the WebFOCUS report named CAR54 in the IBISAMP application is retrieved and written to the Car54.fex file in the c:\temp directory.
try { WebFocus WFservice = new WebFocusLocator(); WebFocusSoap_PortType wfs = WFservice.getWebFocusSoap(); FexInfo report = new FexInfo(); report.setServer("EDASERVE"); report.setApp("IBISAMP"); report.setName("CAR54"); LogOnInfo logon = wfs.webFocusLogOn("RepUser","RepPass","",""); WebFocusReturn ret = wfs.webFocusGetFexText(logon,report); String newOutput=ret.getOutput(); File tempfile = new File("c:\\temp\\Car54.fex"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); out.println(newOutput); out.close(); } catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
Function Name: WebFocusAppCreate
Purpose: To create an application within the WebFOCUS environment.
Input:
Description |
Type |
---|---|
WebFOCUS cookie information. |
LogOnInfo |
Name of application to be created. (No spaces are allowed.) |
String |
Name of the WebFOCUS Reporting Server. |
String |
Output:
Description |
Type |
---|---|
Structure that contains output for WebFOCUS reports and certain WebFOCUS functions. If the return code value within the returned XML is 0, then the application was created successfully. |
WebFocusReturn |
In the following example, an application named WebServices will be created. The return code value is written to the WebFocusAppCreate.xml file in the c:\temp directory.
Dim wfs As New SelfServe.WebFocus Dim logon As New SelfServe.LogOnInfo Dim ret As New SelfServe.WebFocusReturn Dim newOutput As String = "" Dim tempfile As String logon = wfs.WebFocusLogOn("RepUser", "RepPass", "", "") ret = wfs.WebFocusAppCreate(logon, "WebServices", "EDASERVE") newOutput = ret.output tempfile = "c:\temp\WebFocusAppCreate.xml" FileOpen(1, tempfile, OpenMode.Output) Print(1, newOutput) FileClose(1)
Note: SelfServe is the name of the Web Reference.
In the following example, an application named WebServices will be created. The return code value is written to the WebFocusAppCreate.xml file in the c:\temp directory.
try { WebFocus WFservice = new WebFocusLocator(); WebFocusSoap_PortType wfs = WFservice.getWebFocusSoap(); LogOnInfo logon = wfs.webFocusLogOn("RepUser","RepPass","",""); WebFocusReturn ret = wfs.webFocusAppCreate(logon,"WebServices","EDASERVE"); String newOutput=ret.getOutput(); File tempfile = new File("c:\\temp\\WebFocusAppCreate.xml"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); out.println(newOutput); out.close(); } catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
Function Name: WebFocusAppDelete
Purpose: To delete an application from the WebFOCUS environment.
Input:
Description |
Type |
---|---|
WebFOCUS cookie information. |
LogOnInfo |
Name of application to be deleted. (No spaces are allowed.) |
String |
Name of the WebFOCUS Reporting Server. |
String |
Output:
Description |
Type |
---|---|
Structure that contains output for WebFOCUS reports and certain WebFOCUS functions. If the return code value within the returned XML is 0, then the application was deleted successfully. |
WebFocusReturn |
In the following example, an application named WebServices will be deleted. The return code value is written to the WebFocusAppDelete.xml file in the c:\temp directory.
Dim wfs As New SelfServe.WebFocus Dim logon As New SelfServe.LogOnInfo Dim ret As New SelfServe.WebFocusReturn Dim newOutput As String = "" Dim tempfile As String logon = wfs.WebFocusLogOn("RepUser", "RepPass", "", "") ret = wfs.WebFocusAppDelete(logon, "WebServices", "EDASERVE" newOutput = ret.output tempfile = "c:\temp\WebFocusAppDelete.xml" FileOpen(1, tempfile, OpenMode.Output) Print(1, newOutput) FileClose(1)
Note: SelfServe is the name of the Web Reference.
In the following example, an application named WebServices will be deleted. The return code value is written to the WebFocusAppDelete.xml file in the c:\temp directory.
try { WebFocus WFservice = new WebFocusLocator(); WebFocusSoap_PortType wfs = WFservice.getWebFocusSoap(); LogOnInfo logon = wfs.webFocusLogOn("RepUser","RepPass","",""); WebFocusReturn ret = wfs.webFocusAppDelete(logon,"WebServices","EDASERVE"); String newOutput=ret.getOutput(); File tempfile = new File("c:\\temp\\WebFocusAppDelete.xml"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); out.println(newOutput); out.close(); } catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
Function Name: WebFocusAppRename
Purpose: To rename an application within the WebFOCUS environment.
Input:
Description |
Type |
---|---|
WebFOCUS cookie information. |
LogOnInfo |
Name of application to be deleted. (No spaces are allowed.) |
String |
New name of application. (No spaces are allowed.) |
String |
Name of the WebFOCUS Reporting Server. |
String |
Output:
Description |
Type |
---|---|
Structure that contains output for WebFOCUS reports and certain WebFOCUS functions. If the return code value within the returned XML is 0, then the application was renamed successfully. |
WebFocusReturn |
In the following example, an application named WebServices will be renamed to WebServicesAdapter.
The return code value is written to the WebFocusAppRename.xml file in the c:\temp directory.
Dim wfs As New SelfServe.WebFocus Dim logon As New SelfServe.LogOnInfo Dim ret As New SelfServe.WebFocusReturn Dim newOutput As String = "" Dim tempfile As String logon = wfs.WebFocusLogOn("RepUser", "RepPass", "", "") ret = wfs.WebFocusAppRename(logon, "WebServices", "WebServicesAdapter","EDASERVE") newOutput = ret.output tempfile = "c:\temp\WebFocusAppRename.xml" FileOpen(1, tempfile, OpenMode.Output) Print(1, newOutput) FileClose(1)
Note: SelfServe is the name of the Web Reference.
In the following example, an application named WebServices will be renamed to WebServicesAdapter.
The return code value is written to the WebFocusAppRename.xml file in the c:\temp directory.
try { WebFocus WFservice = new WebFocusLocator(); WebFocusSoap_PortType wfs = WFservice.getWebFocusSoap(); WebFocusReturn ret; LogOnInfo logon = wfs.webFocusLogOn("RepUser","RepPass","",""); ret = wfs.webFocusAppRename(logon,"WebServices","WebServicesAdapter", "EDASERVE") ; String newOutput=ret.getOutput(); File tempfile = new File("c:\\temp\\WebFocusAppRename.xml"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); out.println(newOutput); out.close(); } catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
Function Name: WebFocusAppCopyAll
Purpose: To copy the contents of an application within the WebFOCUS environment to another application.
Input:
Description |
Type |
---|---|
WebFOCUS cookie information. |
LogOnInfo |
Name of source application. (No spaces are allowed.) |
String |
Name of target application. (No spaces are allowed.) The application must be created previously. |
String |
Name of the WebFOCUS Reporting Server. |
String |
Output:
Description |
Type |
---|---|
Structure that contains output for WebFOCUS reports and certain WebFOCUS functions. If the return code value within the returned XML is 0, then the application was copied successfully. |
WebFocusReturn |
In the following example, an application named ibisamp will be copied to the WebServices application.
The return code value is written to the WebFocusAppCopyAll.xml file in the c:\temp directory.
Dim wfs As New SelfServe.WebFocus Dim logon As New SelfServe.LogOnInfo Dim ret As New SelfServe.WebFocusReturn Dim newOutput As String = "" Dim tempfile As String logon = wfs.WebFocusLogOn("RepUser", "RepPass", "", "") ret = wfs.WebFocusAppCopyAll(logon, "IBISAMP", "WebServices", "EDASERVE") newOutput = ret.output tempfile = "c:\temp\WebFocusAppCopyAll.xml" FileOpen(1, tempfile, OpenMode.Output) Print(1, newOutput) FileClose(1)
Note: SelfServe is the name of the Web Reference.
In the following example, an application named ibisamp will be copied to the WebServices application.
The return code value is written to the WebFocusAppCopyAll.xml file in the c:\temp directory.
try { WebFocus WFservice = new WebFocusLocator(); WebFocusSoap_PortType wfs = WFservice.getWebFocusSoap(); WebFocusReturn ret; LogOnInfo logon = wfs.webFocusLogOn("RepUser","RepPass","",""); ret = wfs.webFocusAppCopyAll(logon,"IBISAMP","WebServices","EDASERVE"); String newOutput=ret.getOutput(); File tempfile = new File("c:\\temp\\WebFocusAppCopyAll.xml"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); out.println(newOutput); out.close(); } catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
Function Name: WebFocusAppGetFile
Purpose: To retrieve the contents of a file within an application.
Input:
Description |
Type |
---|---|
WebFOCUS cookie information. |
LogOnInfo |
Name of the application. (No spaces are allowed.) |
String |
Name of the file without an extension. (No spaces are allowed.) |
String |
Catalog name of the file (for example, FOCEXEC, GIF, HTML, MASTER, FOCSTYLE). |
String |
Mode of file. T- text H- binary |
String |
Name of the WebFOCUS Reporting Server. |
String |
Output:
Description |
Type |
---|---|
Structure that contains output for WebFOCUS reports and certain WebFOCUS functions. |
WebFocusReturn |
In the following example, a file Car.mas is retrieved from the ibisamp application. The file contents are written to the Car.mas file in the c:\temp directory.
Dim wfs As New SelfServe.WebFocus Dim logon As New SelfServe.LogOnInfo Dim ret As New SelfServe.WebFocusReturn Dim newOutput As String = "" Dim tempfile As String logon = wfs.WebFocusLogOn("RepUser", "RepPass", "", "") ret = wfs.WebFocusAppGetFile(logon, "IBISAMP", "Car", "MASTER", "T", "EDASERVE") newOutput = ret.output tempfile = "c:\temp\Car.mas" FileOpen(1, tempfile, OpenMode.Output) Print(1, newOutput) FileClose(1)
Note: SelfServe is the name of the Web Reference.
In the following example, a file Car.mas is retrieved from the ibisamp application. The file contents are written to the Car.mas file in the c:\temp directory.
try { WebFocus WFservice = new WebFocusLocator(); WebFocusSoap_PortType wfs = WFservice.getWebFocusSoap(); WebFocusReturn ret; LogOnInfo logon = wfs.webFocusLogOn("RepUser","RepPass","",""); ret = wfs.webFocusAppGetFile(logon,"IBISAMP","Car","MASTER","T","EDASERVE"); String newOutput=ret.getOutput(); File tempfile = new File("c:\\temp\\Car.mas"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); out.println(newOutput); out.close(); } catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
Function Name: WebFocusAppDeleteFile
Purpose: To delete a file from within an application.
Input:
Description |
Type |
---|---|
WebFOCUS cookie information. |
LogOnInfo |
Name of the application. (No spaces are allowed.) |
String |
Name of the file without an extension. (No spaces are allowed.) |
String |
Catalog name of the file (for example, FOCEXEC, GIF, HTML, MASTER, FOCSTYLE). |
String |
Name of the WebFOCUS Reporting Server. |
String |
Output:
Description |
Type |
---|---|
Structure that contains output for WebFOCUS reports and certain WebFOCUS functions. If the return code value within the returned XML is 0, then the file was deleted successfully. |
WebFocusReturn |
In the following example, a file named Car2.mas is deleted from the WebServices application. The return code value is written to the WebFocusAppDeleteFile.xml file in the c:\temp directory.
Dim wfs As New SelfServe.WebFocus Dim logon As New SelfServe.LogOnInfo Dim ret As New SelfServe.WebFocusReturn Dim newOutput As String = "" Dim tempfile As String logon = wfs.WebFocusLogOn("RepUser", "RepPass", "", "") ret = wfs.WebFocusAppDeleteFile(logon, "WebServices", "Car2", "MASTER", "EDASERVE") newOutput = ret.output tempfile = "c:\temp\WebFocusAppDeleteFile.xml" FileOpen(1, tempfile, OpenMode.Output) Print(1, newOutput) FileClose(1)
Note: SelfServe is the name of the Web Reference.
In the following example, a file named Car2.mas is deleted from the WebServices application. The return code value is written to the WebFocusAppDeleteFile.xml file in the c:\temp directory.
try { WebFocus WFservice = new WebFocusLocator(); WebFocusSoap_PortType wfs = WFservice.getWebFocusSoap(); WebFocusReturn ret; LogOnInfo logon = wfs.webFocusLogOn("RepUser","RepPass","",""); ret = wfs.webFocusAppDeleteFile(logon,"WebServices","Car2","MASTER","EDASERVE") ; String newOutput=ret.getOutput(); File tempfile = new File("c:\\temp\\WebFocusAppDeleteFile.xml"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); out.println(newOutput); out.close(); } catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
Function Name: WebFocusAppRenameFile
Purpose: To rename a file within an application.
Input:
Description |
Type |
---|---|
WebFOCUS cookie information. |
LogOnInfo |
Name of the application. (No spaces are allowed.) |
String |
Old name of the file without an extension. (No spaces are allowed.) |
String |
New name of the file without an extension. (No spaces are allowed.) |
String |
Catalog name of the file (for example, FOCEXEC, GIF, HTML, MASTER, FOCSTYLE). |
String |
Name of the WebFOCUS Reporting Server. |
String |
Output:
Description |
Type |
---|---|
Structure that contains output for WebFOCUS reports and certain WebFOCUS functions. If the return code value within the returned XML is 0, then the file was renamed successfully. |
WebFocusReturn |
In the following example, a file named Car3.mas within the WebServices application is renamed to Car33.mas.
The return code value is written to the WebFocusAppRenameFile.xml file in the c:\temp directory.
Dim wfs As New SelfServe.WebFocus Dim logon As New SelfServe.LogOnInfo Dim ret As New SelfServe.WebFocusReturn Dim newOutput As String = "" Dim tempfile As String logon = wfs.WebFocusLogOn("RepUser", "RepPass", "", "") ret = wfs.WebFocusAppRenameFile(logon, "WebServices", "Car3", "Car33", "MASTER", "EDASERVE") newOutput = ret.output tempfile = "c:\temp\WebFocusAppRenameFile.xml" FileOpen(1, tempfile, OpenMode.Output) Print(1, newOutput) FileClose(1)
Note: SelfServe is the name of the Web Reference.
In the following example, a file named Car3.mas within the WebServices application is renamed to Car33.mas.
The return code value is written to the WebFocusAppRenameFile.xml file in the c:\temp directory.
try { WebFocus WFservice = new WebFocusLocator(); WebFocusSoap_PortType wfs = WFservice.getWebFocusSoap(); WebFocusReturn ret; LogOnInfo logon = wfs.webFocusLogOn("RepUser","RepPass","",""); ret = wfs.webFocusAppRenameFile(logon,"WebServices","Car3","Car33","MASTER","ED ASERVE"); String newOutput=ret.getOutput(); File tempfile = new File("c:\\temp\\WebFocusAppRenameFile.xml"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); out.println(newOutput); out.close(); } catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
Function Name: WebFocusAppPutFile
Purpose: To save a file within an application.
Input:
Description |
Type |
---|---|
WebFOCUS cookie information. |
LogOnInfo |
Name of the application. (No spaces are allowed.) |
String |
Name of the file without an extension. (No spaces are allowed.) |
String |
Catalog name of the file (for example, FOCEXEC, GIF, HTML, MASTER, FOCSTYLE). |
String |
Number of lines to be saved. |
Integer |
Mode of string data input. C- text CB- binary |
String |
Data input. A CR/LF should follow each line if data is text. |
String |
Name of the WebFOCUS Reporting Server. |
String |
Output:
Description |
Type |
---|---|
Structure that contains output for WebFOCUS reports and certain WebFOCUS functions. If the return code value within the returned XML is 0, then the file was saved successfully. |
WebFocusReturn |
In the following example, WebFOCUS code is written to the Car44.fex file within the WebServices application.
The return code value is written to the WebFocusAppPutFile.xml file in the c:\temp directory.
Dim wfs As New SelfServe.WebFocus Dim logon As New SelfServe.LogOnInfo Dim ret As New SelfServe.WebFocusReturn Dim newOutput As String = "" Dim tempfile As String Dim FocCode As String Dim CRLF As String Dim FC1 As String Dim FC2 As String Dim FC3 As String Dim FC4 As String CRLF = vbCrLf FC1 = "TABLE FILE CAR" FC2 = "SUM DEALER_COST" FC3 = "BY COUNTRY" FC4 = "END" FocCode = FC1 + CRLF + FC2 + CRLF + FC3 + CRLF + FC4 logon = wfs.WebFocusLogOn("RepUser", "RepPass", "", "") ret = wfs.WebFocusAppPutFile(logon, "WebServices", "Car44", "FOCEXEC", 4, "C", FocCode, "EDASERVE") newOutput = ret.output tempfile = "c:\temp\WebFocusAppPutFile.xml" FileOpen(1, tempfile, OpenMode.Output) Print(1, newOutput) FileClose(1)
Note: SelfServe is the name of the Web Reference.
In the following example, WebFOCUS code is written to the Car44.fex file within the WebServices application.
The return code value is written to the WebFocusAppPutFile.xml file in the c:\temp directory.
try { WebFocus WFservice = new WebFocusLocator(); WebFocusSoap_PortType wfs = WFservice.getWebFocusSoap(); WebFocusReturn ret; String CRLF = System.getProperty("line.separator"); String FC1 = "TABLE FILE CAR"; String FC2 = "SUM DEALER_COST"; String FC3 = "BY COUNTRY"; String FC4 = "END"; String FocCode = FC1 + CRLF + FC2 + CRLF + FC3 + CRLF + FC4; LogOnInfo logon = wfs.webFocusLogOn("RepUser","RepPass","",""); ret = wfs.webFocusAppPutFile(logon,"WebServices","Car44","FOCEXEC",4,"C",FocCod e,"EDASERVE"); String newOutput=ret.getOutput(); File tempfile = new File("c:\\temp\\WebFocusAppPutFile.xml"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); out.println(newOutput); out.close(); } catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
Function Name: WebFocusStandardFex
Purpose: The ibiapplets.txt file contains a set of FOCUS procedures that perform various WebFOCUS functions (for example, List Tables, List Fields in a Table, List of Values for a Field, Get a File, Save a File, and Copy an Application). Some Web Service functions already use this file. If the ibiapplets.txt file is customized and additional FOCUS procedures are added, these FOCUS functions can be run using the WebFocusStandardFex function. The ibiapplets.txt file resides in the WebFOCUS53\ibi_html\javaassist directory.
Input:
Description |
Type |
---|---|
WebFOCUS cookie information. |
LogOnInfo |
Names of the FOCUS function. Depending upon the FOCUS functions, more than one function can be passed. |
String Array |
Parameters of the FOCUS function as defined by the ibiapplets.txt file. |
ValuesArrayEntry |
Output:
Description |
Type |
---|---|
Structure that contains output for WebFOCUS reports and certain WebFOCUS functions. |
WebFocusReturn |
The following example shows the MASTER function in the ibiapplets.txt file. This FOCUS function retrieves a list of Master Files.
StringArray,MASTER -DEFAULTS &&IBIBIPMS=' ' SET CDN=OFF SET LINES=10000 SET PAGE=NOPAGE SET XMLTYPE=DISPLAY SQL FMI SET FILECASE UPPER -IF &FOCMODE NE 'MSO' OR 'TSO' THEN GOTO NOTTSO; -? TSO DDNAME IBIBIPMS -SET &&IBIBIPMS=IF &DSNAME EQ ' ' THEN ' ' ELSE 'IBIBIPMS'; -IF &&IBIBIPMS EQ ' ' THEN GOTO MASTAB; -GOTO OKTSO -* -NOTTSO -IF &&IBIBIPMS EQ ' ' GOTO MASTAB; FILEDEF IBIBIPMS DISK &&IBIBIPMS -* -OKTSO DEFINE FILE SYSTABLE "MFDNAME/A64 = UPCASE(64,NAME,'A64');" "IBIBIPMS/I1 = DECODE MFDNAME(IBIBIPMS ELSE 1);" END -MASTAB TABLE FILE SYSTABLE PRINT REMARKS AS '' BY NAME AS '' -IF &&IBIBIPMS EQ ' ' GOTO IBINOINC; WHERE IBIBIPMS NE 1 -IBINOINC ON TABLE &HOLDTYPE FORMAT XML END EndStringArray,MASTER
In the following example, a list of Master Files is written to the Masters.txt file in the c:\temp directory.
Dim wfs As New SelfServe.WebFocus Dim logon As New SelfServe.LogOnInfo Dim ret As New SelfServe.WebFocusReturn Dim newOutput As String = "" Dim tempfile As String Dim param1 As New SelfServe.ValuesArrayEntry Dim params As Array = Array.CreateInstance(GetType(SelfServe.ValuesArrayEntry), 1) Dim routine As Array = Array.CreateInstance(GetType(String), 1) Dim i As Integer routine(0) = "MASTER" param1.name = "HOLDTYPE" param1.val = "PCHOLD" params(0) = param1 logon = wfs.WebFocusLogOn("RepUser", "RepPass", "", "") ret = wfs.WebFocusStandardFex(logon, routine, params) newOutput = ret.output tempfile = "c:\temp\Masters.txt" FileOpen(1, tempfile, OpenMode.Output) For i = 0 To ret.values(0).Length - 1 newOutput = ret.values(0)(i) PrintLine(1, newOutput) Next i FileClose(1)
Note: SelfServe is the name of the Web Reference.
In the following example, a list of Master Files is written to the Masters.txt file in the c:\temp directory.
try { WebFocus WFservice = new WebFocusLocator(); WebFocusSoap_PortType wfs = WFservice.getWebFocusSoap(); ValuesArrayEntry[] param; param = new ValuesArrayEntry[1]; ValuesArrayEntry param1 = new ValuesArrayEntry(); param1.setName("HOLDTYPE"); param1.setVal("PCHOLD"); param[0] = param1; StringArray[][] StringArray; String[] routine; routine = new String[1]; routine[0] = "MASTER";
LogOnInfo logon = wfs.webFocusLogOn("RepUser","RepPass","",""); WebFocusReturn ret = wfs.webFocusStandardFex(logon,routines, param); String newOutput = null; File tempfile = new File("c:\\temp\\Masters.txt"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); StringArray = ret.getValues(); for ( int i=0; i<StringArray[0].length; i++ ) { newOutput = StringArray[0][i]; out.println(newOutput); } out.close(); } catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
Function Name: WebFocusTracing
Purpose: Turning on/off traces used for debugging of WebFOCUS Web Services function calls. You can also accomplish this by turning on/off the UDDI traces using http://WebFOCUS location/ibi_apps/tracing.jsp. See Troubleshooting WebFOCUS Web Services for details.
Input:
Description |
Type |
---|---|
WebFOCUS cookie information. |
LogOnInfo |
Turn on traces is true. Turn off traces is false. |
Boolean |
Output:
Description |
Type |
---|---|
Structure that contains current configuration information about WebFOCUS Web Services. This is the configuration information retrieved into the WSDLInfoEntry structure, which is a sub-structure of the WSDLInfoStruct structure. |
WSDLInfoStruct |
In the following example, the UDDI traces are turned on. The trace status is written to the Trace.txt file in the c:\temp directory.
Dim wfs As New SelfServe.WebFocus Dim logon As New SelfServe.LogOnInfo Dim retTrace As New SelfServe.WSDLInfoStruct Dim newOutput As String = "" Dim tempfile As String logon = wfs.WebFocusLogOn("RepUser", "RepPass", "", "") retTrace = wfs.WebFocusTracing(logon, True) newOutput = retTrace.WSDLInfo.IBIUDDI_trace tempfile = "c:\temp\Trace.txt" FileOpen(1, tempfile, OpenMode.Output) Print(1, newOutput) FileClose(1)
Note: SelfServe is the name of the Web Reference.
In the following example, the UDDI traces are turned on. The trace status is written to the Trace.txt file in the c:\temp directory.
try { WebFocus WFservice = new WebFocusLocator(); WebFocusSoap_PortType wfs = WFservice.getWebFocusSoap(); LogOnInfo logon = wfs.webFocusLogOn("RepUser","RepPass","",""); WSDLInfoStruct retTrace = wfs.webFocusTracing(logon,true); WSDLInfoEntry WSDLstruct; WSDLstruct = retTrace.getWSDLInfo(); boolean newOutput = WSDLstruct.isIBIUDDI_trace(); File tempfile = new File("c:\\temp\\Trace.txt"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); out.println(newOutput); out.close(); } catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
Function Name: WebFocusWSDLInfo
Purpose: To get information about the current configuration of WebFOCUS Web Services.
Input:
Description |
Type |
---|---|
WebFOCUS cookie information. |
LogOnInfo |
Output:
Description |
Type |
---|---|
Structure that contains current configuration information about WebFOCUS Web Services. This is the configuration information retrieved into the WSDLInfoEntry structure, which is a sub-structure of the WSDLInfoStruct structure. |
WSDLInfoStruct |
In the following example, current configuration information about WebFOCUS Web Services are written to the WSConfig.txt file in the c:\temp directory.
Dim wfs As New SelfServe.WebFocus Dim logon As New SelfServe.LogOnInfo Dim retWSDL As New SelfServe.WSDLInfoStruct Dim newOutput As String = "" Dim tempfile As String logon = wfs.WebFocusLogOn("RepUser", "RepPass", "", "") retWSDL = wfs.WebFocusWSDLInfo(logon) tempfile = "c:\temp\WSConfig.txt" newOutput = retWSDL.WSDLInfo.IBIUDDI_webApplocation + " " _ + retWSDL.WSDLInfo.IBIC_server + " " _ + retWSDL.WSDLInfo.IBIUDDI_cgiLocation FileOpen(1, tempfile, OpenMode.Output) Print(1, newOutput) FileClose(1)
Note: SelfServe is the name of the Web Reference.
In the following example, current configuration information about WebFOCUS Web Services are written to the WSConfig.txt file in the c:\temp directory.
try { WebFocus WFservice = new WebFocusLocator(); WebFocusSoap_PortType wfs = WFservice.getWebFocusSoap(); LogOnInfo logon = wfs.webFocusLogOn("RepUser","RepPass","",""); WSDLInfoStruct retWSDL = wfs.webFocusTracing(logon,false); WSDLInfoEntry WSDLstruct; WSDLstruct = retWSDL.getWSDLInfo(); String newOutput = WSDLstruct.getIBIUDDI_webApplocation() + " " + WSDLstruct.getIBIC_server() + " " + WSDLstruct.getIBIUDDI_cgiLocation(); File tempfile = new File("c:\\temp\\WSConfig.txt"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); out.println(newOutput); out.close(); } catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
Function Name: WebFocusFormatWhere
Purpose: To convert the String Array of values for a parameter to a formatted condition value to use in the WebFOCUS WHERE statement (for example, 'EASTERN' OR 'CORPORATE'). This function is mainly used for passing multiple values for a parameter within a URL call to WebFOCUS. The WebFocusRunFex function does this automatically.
Input:
Description |
Type |
---|---|
WebFOCUS cookie information. |
LogOnInfo |
Structure that contains information about running the WebFOCUS report. The parameters are retrieved into the ValuesArrayEntry structure that is a sub-structure of the FexInfo structure. |
FexInfo |
Output:
Description |
Type |
---|---|
Structure that contains information about running the WebFOCUS report. The parameters are retrieved into the ValuesArrayEntry structure that is a sub-structure of the FexInfo structure. |
FexInfo |
In the following example, the formatted condition value for the REGION parameter of a WebFOCUS report named Sales_Report_4 is written to the WebFocusFormatWhere.txt file in the c:\temp directory.
Dim wfs As New SelfServe.WebFocus Dim logon As New SelfServe.LogOnInfo Dim report As New SelfServe.FexInfo Dim FexinfoOut As New SelfServe.FexInfo Dim param1 As New SelfServe.ValuesArrayEntryDim multivalues As Array = Array.CreateInstance(GetType(String), 2) Dim params As Array = Array.CreateInstance(GetType(SelfServe.ValuesArrayEntry), 1) Dim newOutput As String = "" Dim tempfile As String param1.name = "REGION" multivalues(0) = "EASTERN" multivalues(1) = "CORPORATE" param1.StringArray = multivalues param1.multi = True param1.quote = True param1.operation = "OR" params(0) = param1 report.server = "EDASERVE" report.app = "Sales_Demo" report.name = "Sales_Report_4" report.IBIWS_arrayvalues = params logon = wfs.WebFocusLogOn("RepUser", "RepPass", "", "") FexinfoOut = wfs.WebFocusFormatWhere(logon, report) newOutput = FexinfoOut.IBIWS_arrayvalues(0).val tempfile = "c:\temp\WebFocusFormatWhere.txt" FileOpen(1, tempfile, OpenMode.Output) Print(1, newOutput) FileClose(1)
Note: SelfServe is the name of the Web Reference.
In the following example, the formatted condition value for the REGION parameter of a WebFOCUS report named Sales_Report_4 is written to the WebFocusFormatWhere.txt file in the c:\temp directory.
try { WebFocus WFservice = new WebFocusLocator(); WebFocusSoap_PortType wfs = WFservice.getWebFocusSoap(); ValuesArrayEntry[] param; param = new ValuesArrayEntry[1]; ValuesArrayEntry param1 = new ValuesArrayEntry(); String[] multivalues; multivalues = new String[2]; param1.setName("REGION"); multivalues[0] = "EASTERN"; multivalues[1] = "CORPORATE"; param1.setStringArray(multivalues); param1.setMulti(true); param1.setQuote(true); param1.setOperation("OR");
param[0] = param1; FexInfo report = new FexInfo(); report.setServer("EDASERVE"); report.setApp("Sales_Demo"); report.setName("Sales_Report_4"); report.setIBIWS_arrayvalues(param); LogOnInfo logon = wfs.webFocusLogOn("RepUser","RepPass","",""); FexInfo fexinfoOut = wfs.webFocusFormatWhere(logon,report); ValuesArrayEntry[] Values; Values = fexinfoOut.getIBIWS_arrayvalues(); String newOutput= Values[0].getVal(); File tempfile = null;
tempfile = new File("c:\\temp\\WebFocusFormatWhere.txt"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); out.println(newOutput); out.close(); } catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
Function Name: WebFocusAPI
Purpose: To run WebFOCUS API commands.
Input:
Description |
Type |
---|---|
WebFOCUS cookie information. |
LogOnInfo |
Structure that contains information about the parameters for a WebFOCUS report. |
ValuesArrayEntry |
Output:
Description |
Type |
---|---|
Structure that contains the output from a WebFOCUS report. |
WebFocusReturn |
In the following example, a drill-down report CARDRILL is simulated for CAR=JAGUAR. The output from the report is written to the DrillReport.htm file in the c:\temp directory.
Dim wfss As New SelfServe.WebFocus Dim ret As New SelfServe.WebFocusReturn Dim loginfo As New SelfServe.LogOnInfo Dim newOutput As String = "" Dim tempfile As String Dim parm1 As New SelfServe.ValuesArrayEntry Dim parm2 As New SelfServe.ValuesArrayEntry Dim parm3 As New SelfServe.ValuesArrayEntry Dim parm4 As New SelfServe.ValuesArrayEntry Dim parm5 As New SelfServe.ValuesArrayEntry Dim params As Array = Array.CreateInstance(GetType(SelfServe.ValuesArrayEntry), 5) parm1.name = "IBIC_server" parm1.val = "EDASERVE" params(0) = parm1 parm2.name = "IBIAPP_app" parm2.val = "ibisamp" params(1) = parm2 parm3.name = "IBIF_ex" parm3.val = "cardrill" params(2) = parm3 parm4.name = "CLICK_ON" params(3) = parm4 parm5.name = "CAR" parm5.val = "JAGUAR" params(4) = parm5 loginfo = wfss.WebFocusLogOn("RepUser", "RepPass", "", "") ret = wfss.WebFocusAPI(loginfo, params) newOutput = ret.output tempfile = "c:\temp\DrillReport.htm" FileOpen(1, tempfile, OpenMode.Output) Print(1, newOutput) FileClose(1)
Note: SelfServe is the name of the Web Reference.
In the following example, a drill-down report CARDRILL is simulated for CAR=JAGUAR. The output from the report is written to the DrillReport.htm file in the c:\temp directory.
try { WebFocus WFservice = new WebFocusLocator(); WebFocusSoap_PortType wfs = WFservice.getWebFocusSoap(); ValuesArrayEntry[] param; param = new ValuesArrayEntry[5]; ValuesArrayEntry param1 = new ValuesArrayEntry(); param1.setName("IBIC_server"); param1.setVal("EDASERVE"); param[0] = param1; ValuesArrayEntry param2 = new ValuesArrayEntry(); param2.setName("IBIAPP_app"); param2.setVal("ibisamp"); param[1] = param2; ValuesArrayEntry param3 = new ValuesArrayEntry(); param3.setName("IBIF_ex"); param3.setVal("cardrill"); param[2] = param3;
ValuesArrayEntry param4 = new ValuesArrayEntry(); param4.setName("CLICK_ON"); param[3] = param4; ValuesArrayEntry param5 = new ValuesArrayEntry(); param5.setName("CAR"); param5.setVal("JAGUAR"); param[4] = param5; LogOnInfo logon = wfs.webFocusLogOn("RepUser","RepPass","",""); WebFocusReturn ret = wfs.webFocusAPI(logon,param); String newOutput=ret.getOutput(); File tempfile = null; tempfile = new File("c:\\temp\\DrillReport.htm"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); out.println(newOutput); out.close(); } catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
Function Name: Name of the Web Service Function + Reflection
For example, if the name of the Web Service function is car54, the function name for retrieving the parameters is car54Reflection.
Purpose: To retrieve the parameters of a WebFOCUS report created as a Web Service function. See Using the WebFOCUS WSDL Creation Utility for details about making a WebFOCUS report its own Web Service function. When this is complete, this function for retrieving the parameters of this report is also created.
Input:
Description |
Type |
---|---|
WebFOCUS cookie information. |
LogOnInfo |
Output:
Description |
Type |
---|---|
Structure that contains information about running the WebFOCUS report. The parameters are retrieved into the ValuesArrayEntry structure that is a sub-structure of the FexInfo structure. |
FexInfo |
In the following example, the parameters for a WebFOCUS Report called Car54 is written to the Car54Parms.txt file in the c:\temp directory.
Dim wfs As New SelfServe.WebFocus Dim logon As New SelfServe.LogOnInfo Dim fexinfoOut As New SelfServe.FexInfo Dim newOutput As String Dim tempfile As String Dim i As Integer logon = wfs.WebFocusLogOn("RepUser", "RepPass", "", "") fexinfoOut = wfs.car54Reflection(logon) tempfile = "c:\temp\Car54Parms.txt" FileOpen(1, tempfile, OpenMode.Output) For i = 0 To fexinfoOut.IBIWS_arrayvalues.Length - 1 newOutput = fexinfoOut.IBIWS_arrayvalues(i).prompt + " " _ + fexinfoOut.IBIWS_arrayvalues(i).name + " " _ + fexinfoOut.IBIWS_arrayvalues(i).defaultVal PrintLine(1, newOutput) Next i FileClose(1)
Note: SelfServe is the name of the Web Reference.
In the following example, the parameters for a WebFOCUS Report called Car54 is written to a file Car54Parms.txt in the c:\temp directory.
try { WebFocus WFservice = new WebFocusLocator(); WebFocusSoap_PortType wfs = WFservice.getWebFocusSoap(); ValuesArrayEntry[] Values; LogOnInfo logon = wfs.webFocusLogOn("RepUser","RepPass","",""); FexInfo fexinfoOut = wfs.car54Reflection(logon); String newOutput = null; File tempfile = new File("c:\\temp\\Car54Parms.txt"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); Values = fexinfoOut.getIBIWS_arrayvalues(); for ( int i=0; i<Values.length; i++ ) { newOutput = Values[i].getPrompt() + " " + Values[i].getName() + " " + Values[i].getDefaultVal(); out.println(newOutput); } out.close(); } catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
Function Name: Name of the Web Service Function + GetFexText
For example, if the name of the Web Service function is car54, the function name for retrieving the WebFOCUS code is car54GetFexText.
Purpose: To get the WebFOCUS code for a WebFOCUS report created as a Web Service function. See Using the WebFOCUS WSDL Creation Utility for details about making a WebFOCUS report its own Web Service function. When this is complete, this function for getting WebFOCUS code for this report is also created.
Input:
Description |
Type |
---|---|
WebFOCUS cookie information. |
LogOnInfo |
Output:
Description |
Type |
---|---|
Structure that contains output for WebFOCUS reports and certain WebFOCUS functions. |
WebFocusReturn |
In the following example, the WebFOCUS code for a WebFOCUS Report called Car54 is written to the Car54Code.fex file in the c:\temp directory.
Dim wfs As New SelfServe.WebFocus Dim logon As New SelfServe.LogOnInfo Dim ret As New SelfServe.WebFocusReturn Dim newOutput As String Dim tempfile As String logon = wfs.WebFocusLogOn("RepUser", "RepPass", "", "") ret = wfs.car54GetFexText(logon) tempfile = "c:\temp\Car54Code.fex" FileOpen(1, tempfile, OpenMode.Output) newOutput = ret.output Print(1, newOutput) FileClose(1)
Note: SelfServe is the name of the Web Reference.
In the following example, the WebFOCUS code for a WebFOCUS Report called Car54 is written to the Car54Code.fex file in the c:\temp directory.
try { WebFocus WFservice = new WebFocusLocator(); WebFocusSoap_PortType wfs = WFservice.getWebFocusSoap(); LogOnInfo logon = wfs.webFocusLogOn("RepUser","RepPass","",""); WebFocusReturn ret = wfs.car54GetFexText(logon); String newOutput = ret.getOutput(); File tempfile = new File("c:\\temp\\Car54Code.fex"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); out.println(newOutput); out.close(); } catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
WebFOCUS |