Focal Point
[SOLVED] Creating schedules with REST from an embedded app

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/1767083096

June 15, 2018, 11:23 AM
juram
[SOLVED] Creating schedules with REST from an embedded app
We have a .NET application with embedded WebFOCUS reports, and are looking at adding the ability for users to schedule those reports. The full blown RC interface is not an option so we're looking at using web services. If we wanted to create schedules by calling a fex, would we need to be licensed for both the enablement option and the REST adapter?

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS 8.0.08
Windows, All Outputs
June 15, 2018, 11:36 AM
dhagen
You should contact your local IBI SE or Sales Rep for that answer.


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
June 17, 2018, 07:04 AM
Efrem
If you plan on doing this scheduling from your .NET application, there's no need for the REST adapter.

I see that you're on WebFOCUS 8.0.08.

In WebFOCUS 8203, we introduced a WebFOCUS Client adapter which does not have to be licensed which has out-of-the-box examples of using WebFOCUS Reports (Fexes) to create ReportCaster Schedules.

Since this adapter calls WebFOCUS RESTful Web Services, as dhagen stated, you should contact your IBI SE or Sales Rep for licensing requirements.
June 18, 2018, 05:03 PM
juram
Thanks Efrem. I spoke with my rep this afternoon and it sounds like the client adapter in 8203 is a good fit for what I'm trying to achieve. Unfortunate I had to leave Summit before the last track on Thursday or I could have caught your presentation and already made some progress on this.


WebFOCUS 8.0.08
Windows, All Outputs
July 24, 2018, 02:51 PM
juram
We're hitting a lot of issues upgrading to 8.2 so I'm looking at how I can implement in 8.0.08 using the REST adapter and enablement option, but struggling to create the metadata. I see a lot of synonyms in other posts but none for create folder/create schedule/delete schedule. Any chance someone can post those, or better yet teach me how to fish and point me to a reference on creating them?


WebFOCUS 8.0.08
Windows, All Outputs
July 24, 2018, 02:59 PM
Efrem
Juram,
I think you should open a Hottrack case.

They would know how to get you examples.
July 24, 2018, 03:27 PM
Doug
Please include a reference to This Post as well.

Thanks, Doug ( c/o Annette Smiler )




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
July 24, 2018, 03:44 PM
juram
I opened a case.

I'm able to generate metadata through the web console, but I'm crashing the server trying to use it. Can you tell me how you went about creating the synonyms I see on a lot of your posts? A lot of blood, sweat, and tears?


WebFOCUS 8.0.08
Windows, All Outputs
July 24, 2018, 04:17 PM
Efrem
You should get my Summit presentation on how to integrate both the REST adapter and the new WebFOCUS Client adapter with WebFOCUS RESTful Web Services.

In WebFOCUS 8203, there is an out-of-box solution of this which includes Metadata and Fex examples.
The WebFOCUS Client adapter simplifies everything.
July 24, 2018, 04:53 PM
juram
I have your Summit presentation, and using that stack was able to develop a solution that's working very well. It's definitely much simpler than trying to use the REST adapter directly. My only problem is the solution is now tied to the upgrade and we're hitting some bumps in that road, so I'm looking for a fallback using 8.0.08.


WebFOCUS 8.0.08
Windows, All Outputs
July 25, 2018, 07:27 AM
Efrem
Juram,
In your 8008 environment, do you have CSRF Enforcement enabled.
Check under Filters in the Administration Console.
July 25, 2018, 07:56 AM
Efrem
Juram,
Ignore my previous post.
CSRF was not implemented for WebFOCUS RESTful Web Services in 8008.

Do you have the samples from the WebFOCUS Client adapter in 8203.

If so, you can take the ReportCaster examples and I can tell you what to change to make them work with the REST adapter.

I don't have 8008 but I was able to create a schedule in 8010.

Efrem
July 25, 2018, 08:19 AM
juram
Yes I have the samples from the client adapter. I tried to convert for use with the REST adapter, but with limited success. Any help converting those would be much appreciated.


WebFOCUS 8.0.08
Windows, All Outputs
July 25, 2018, 08:40 AM
Efrem
Juram,
1/ Add a REST adapter Connection with the URL being http://machinename:8080/ibi_apps

2/ Perform Create Synonym for the signOn call. It should be an Insert(Post) and enter something similar to the following in Document Sample:
IBIRS_action=signOn&IBIRS_userName=admin&IBIRS_password=admin

3/ Modify the REST connection to select Chain Authentication from the Security Dropdown box.
Select the synonym created in Step #2.

4/ Change the SUFFIX in create_schedule.mas from WFCREST to REST.

5/ As an example, use create_schedule_once_mr_library.fex for the following changes.
Or, you can use one of the other Create Schedule examples.

Replace the Start Date in Local Time and the Convert Date to Unix Time Stamp to the following:
-* Start Date in Local Time
-SET &STARTDATE = '2050-07-08 14:00:00';
-*
-SET &NOW = HGETC(8,'HYYMDs');
-SET &NOWZ = HGETZ(8,'HYYMDs');
-SET &ANOW = FPRINT(&NOW,'HYYMDs','A20');
-SET &ANOWZ = FPRINT(&NOWZ,'HYYMDs','A20');
-SET &OFFSET = HDIFF(&NOWZ,&NOW,'HOURS','D6.2');
-SET &STARTDATE_HYYMDS = HINPUT(19, &STARTDATE, 8, 'HYYMDS');
-SET &STARTDATE_GMT = HADD(&STARTDATE_HYYMDS, 'HOURS', &OFFSET , 8, 'HYYMDS');

-*Convert Date to Unix Time Stamp
-SET &BASEDATE_HYYMDS=HINPUT(19, '1970-01-01 00:00:00', 8, 'HYYMDS');
-SET &UNIXTIME_START = LJUST(20,FTOA(HDIFF(&STARTDATE_GMT,&BASEDATE_HYYMDS,'ss','D20') * 1000 , '(D20c)', 'A20'), 'A20');

6/ Make sure you change the application qualification on the TABLE FILE statement to the appropriate application.

Good Luck!

Efrem
July 25, 2018, 08:42 AM
Efrem
Juram,
I should also mention that the Service URL Extension for Step #2 should be rs/ibfs .

Efrem