Creating webservices with Universal Display Files

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
dieter
Experienced User
Posts: 122
Joined: Tue May 22, 2012 6:45 am
First Name: Dieter
Last Name: Schröder
Company Name: Ecclesia Holding GmbH
State / Province: Outside Canada/USA
Country: Germany
Contact:

Creating webservices with Universal Display Files

Post by dieter »

I have heard that the new feature "Universal Display Files" can make it easy to create a webservice. My first question is, how much data can be read by a universal display file? I think the browser posts data to the webserver. The universal display file will receive the data and with an rpg read i can get the data. Is that correct?

If this is correct, how many data is the maximum? A normal display file record has a limited size of 32 kilobytes. Is this the maximum, i can get from the browser? Or is there a trick to get more data by using a loop in rpg?

And here my next question: We are on Profound version 4.8.6. We have a second instance with version 5.0.1. Can we write a webservice with universal display files? How does the webservice program knows which instance it has to use? Is the Libl important? Normaly we start our Genie session with a specific url. So with the url it is clear which instance to use. But i think, a webservice with universal display files is not started in a Genie session.

We already have implemented a few webservices by using IBM apis. The call for the webservice program are configured in the httpd.conf of our Apache server in the iSeries. Can our existing webservice program (we call it our "webservice handler") call a rpg program which uses universal display files? Which instance would it use?

Sorry for my poor English!

Dieter
User avatar
David
Profound Logic Staff Member
Posts: 690
Joined: Fri Jan 04, 2008 12:11 pm
First Name: David
Last Name: Russo
Company Name: Profound Logic Software
Contact:

Re: Creating webservices with Universal Display Files

Post by David »

Universal Display Files (UDF) are a general purpose tool for creating dynamic text documents (of any type) which are either written to the IFS or output to the HTTP server. So, yes, they can be used to produce web services by outputting dynamic XML documents. However, UDF is not designed around web services specifically, so it does not implement any web services protocols, such as SOAP, etc.

Universal Display Files are driven by an RPG Open Access Handler, which works around RPG file I/O operations. So, yes, the limit of 32KB for a file record format applies to Universal Display Files and this is the maximum amount of input you can receive from a single READ. We may provide further options in the future.

For now, you could look for the environment variable PUI_UNIVERSAL_INPUT in the job. It will be set to contain the entire POST buffer. You can also look at environment variables like CONTENT_TYPE, etc. For example, you could use these two environment variables to determine when a request is made with content type 'text/xml' and then interpret the PUI_UNIVERSAL_INPUT as an XML document. All the input from the HTTP server should be in UTF-8, not EBCDIC.

Regarding URLs, the UDF programs must be run using the Universal Display File Web Connector. See the documentation page on that here:

http://www.profoundlogic.com/docs/displ ... +Connector

If you want to use the UDF programs running in the Web Connector as the target of properties like 'choices url', etc. in the Profound UI / Genie Designers, all you have to do is specify the property like this:

/profoundui/universal/yourprogram

Profound UI / Genie will automatically send a session id on the request, which will cause the UDF request to run as the same user profile and with the same library list. This requires running the UDF program from the Web Connector on the same instance as the Genie session.
dieter
Experienced User
Posts: 122
Joined: Tue May 22, 2012 6:45 am
First Name: Dieter
Last Name: Schröder
Company Name: Ecclesia Holding GmbH
State / Province: Outside Canada/USA
Country: Germany
Contact:

Re: Creating webservices with Universal Display Files

Post by dieter »

Thanks for the info.
Dieter
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests