Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] WebFOCUS RESTful Web Services

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] WebFOCUS RESTful Web Services
 Login/Join
 
Platinum Member
posted
Anyone in this forum has created a Web Service which calls WebFOCUS RESTful Web Services? (a Web Service calls another Web Service). Our platform mainly is HTML/jQuery/SQL Server and WebFOCUS8.2 in Windows Server 2012R2, and our apps are mainly WebFOCUS self-service applications. If you have experience and can share your knowledge, it is greatly appreciated.

This message has been edited. Last edited by: FP Mod Chuck,
 
Posts: 118 | Location: Omaha, NE | Registered: June 12, 2003Report This Post
Expert
posted Hide Post
I think I am a bit confused with your request.

Is a third part app calling WebFOCUS RESTful API expecting JSON to be returned or something else ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Platinum Member
posted Hide Post
Thanks Waz! I updated my post after discussing the project requirements. It is a project that one web service calls another web service (WebFOCUS REST Web Service) project. WebFOCUS REST Web Service returns JSON object to calling Web Service, and this We Service returns same JSON object to a web application.

This message has been edited. Last edited by: Lusheng,
 
Posts: 118 | Location: Omaha, NE | Registered: June 12, 2003Report This Post
Member
posted Hide Post
Hi Lusheng. Do you have a specific question?

Have you read the WebFOCUS manual "WebFOCUS Embedded Business Intelligence User's Guide Release 8.2 Version 03" available at https://webfocusinfocenter.inf...dded_bi_user8203.pdf ? It has examples in JavaScript.

I have experience using the REST API with Python. I will be posting my code, a Python wrapper for many of the WF REST calls, to GitHub in the next month or so.

A good module for making HTTP (REST) requests will handle putting the HTTP header and body together. Python's Requests library (http://docs.python-requests.org/en/master/) and JavaScript Request (https://github.com/request/request) are both relatively easy to use.

Here is an example (prompted by Waz) to run an ad hoc fex and return JSON. And I highly recommend using Fiddler for debugging REST calls (https://www.telerik.com/fiddler)


URL: http://localhost:8080/ibi_apps/rs/ibfs/EDA

Header: {'User-Agent': 'python-requests/2.18.4', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Cookie': 'WF-JSESSIONID=12E4A798EE2EAF81232EC5A5884471D5', 'Content-Length': '248', 'Content-Type': 'application/x-www-form-urlencoded'}

Body (manually formatted):
IBIRS_action=runAdHocFex &
IBIRS_path=EDA &
IBIRS_nodeName=EDASERVE &
IBIRS_fexContent=TABLE+FILE+CAR%0APRINT+%0A++MPG%0A++SEATS%0ABY+COUNTRY%0ABY+CAR%0ABY+MODEL%0AON+TABLE+PCHOLD+FORMAT+JSON%0AEND%0A&IBIWF_SES_AUTH_TOKEN=f149ec78dfcced2f9eb2520af06ebd7b

The ad hoc (inline) fex is:
TABLE FILE CAR
PRINT
MPG
SEATS
BY COUNTRY
BY CAR
BY MODEL
ON TABLE PCHOLD FORMAT JSON
END


Results:
{"records" : [{"COUNTRY" : "ENGLAND","CAR" : "JAGUAR","MODEL" : "V12XKE AUTO","MPG" : 16,"SEATS" : 2},{"COUNTRY" : "ENGLAND","CAR" : "JAGUAR","MODEL" : "XJ12L AUTO","MPG" : 9,"SEATS" : 5},{"COUNTRY" : "ENGLAND","CAR" : "JENSEN","MODEL" : "INTERCEPTOR III","MPG" : 11,"SEATS" : 4},{"COUNTRY" : "ENGLAND","CAR" : "TRIUMPH","MODEL" : "TR7","MPG" : 25,"SEATS" : 2},{"COUNTRY" : "FRANCE","CAR" : "PEUGEOT","MODEL" : "504 4 DOOR","MPG" : 21,"SEATS" : 5},{"COUNTRY" : "ITALY","CAR" : "ALFA ROMEO","MODEL" : "2000 4 DOOR BERLINA","MPG" : 21,"SEATS" : 4},{"COUNTRY" : "ITALY","CAR" : "ALFA ROMEO","MODEL" : "2000 GT VELOCE","MPG" : 21,"SEATS" : 2},{"COUNTRY" : "ITALY","CAR" : "ALFA ROMEO","MODEL" : "2000 SPIDER VELOCE","MPG" : 21,"SEATS" : 2},{"COUNTRY" : "ITALY","CAR" : "MASERATI","MODEL" : "DORA 2 DOOR","MPG" : 0,"SEATS" : 2},{"COUNTRY" : "JAPAN","CAR" : "DATSUN","MODEL" : "B210 2 DOOR AUTO","MPG" : 0,"SEATS" : 4},{"COUNTRY" : "JAPAN","CAR" : "TOYOTA","MODEL" : "COROLLA 4 DOOR DIX AUTO","MPG" : 27,"SEATS" : 4},{"COUNTRY" : "W GERMANY","CAR" : "AUDI","MODEL" : "100 LS 2 DOOR AUTO","MPG" : 23,"SEATS" : 5},{"COUNTRY" : "W GERMANY","CAR" : "BMW","MODEL" : "2002 2 DOOR","MPG" : 24,"SEATS" : 5},{"COUNTRY" : "W GERMANY","CAR" : "BMW","MODEL" : "2002 2 DOOR AUTO","MPG" : 24,"SEATS" : 4},{"COUNTRY" : "W GERMANY","CAR" : "BMW","MODEL" : "3.0 SI 4 DOOR","MPG" : 18,"SEATS" : 5},{"COUNTRY" : "W GERMANY","CAR" : "BMW","MODEL" : "3.0 SI 4 DOOR AUTO","MPG" : 18,"SEATS" : 5},{"COUNTRY" : "W GERMANY","CAR" : "BMW","MODEL" : "530I 4 DOOR","MPG" : 18,"SEATS" : 5},{"COUNTRY" : "W GERMANY","CAR" : "BMW","MODEL" : "530I 4 DOOR AUTO","MPG" : 18,"SEATS" : 5}]}

Python source code (using Requests) module:

def rs_run_ad_hoc_fex(self, nodename='EDASERVE', fex_content=''):
"""Reporting Server: Running a Report Within an Application."""

method = 'post'
data = {
'IBIRS_action': 'runAdHocFex',
'IBIRS_path': 'EDA',
'IBIRS_nodeName': nodename,
'IBIRS_fexContent': fex_content
}
url = '{}://{}:{}/ibi_apps/rs/ibfs/EDA'.format(self.protocol,
self.host,
self.port)

# add the CSRF token value to the body (data) of the request
if self.IBIWF_SES_AUTH_TOKEN is not None:
data['IBIWF_SES_AUTH_TOKEN'] = self.IBIWF_SES_AUTH_TOKEN

return self.request(method=method, url=url, data=data)


Prior to making the REST call, the user or calling program must sign on and also get session authorization token to use in subsequent calls.
 
Posts: 13 | Location: New York City | Registered: March 01, 2010Report This Post
Platinum Member
posted Hide Post
Thanks Ira for sharing your python example! I have tested IBI's HTML and jQuery Example in my local host and that works fine. The issue is how to create another Web Service to call IBI's REST Web Service.
 
Posts: 118 | Location: Omaha, NE | Registered: June 12, 2003Report This Post
Member
posted Hide Post
Lusheng, I don't do web development, but my understanding is a web service is simply a program. So, in this case program #1 (your web service) is calling program #2 (the WF REST service). What is tripping you up?
 
Posts: 13 | Location: New York City | Registered: March 01, 2010Report This Post
Expert
posted Hide Post
Agreed, this seems to be a more generic question of creating a RESTful Web Service what is not WebFOCUS based.

May be worth googling creating a RESTful web service.

Is there a reason for needing two Web Services to return the results to the APP ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] WebFOCUS RESTful Web Services

Copyright © 1996-2020 Information Builders