简体   繁体   中英

HTTP Server Connector in IBM Security (Tivoli) Directory Integrator

I am using IBM Security Directory Integrator, formerly known as IBM Tivoli Directory Integrator, and in the feed section I have one connector that is connecting to a MySQL Database and providing data from the database, I want the data from the MySQL database to be displayed on a web page using an HTTP Server connector, however none of the attributes in the WORK object are available as output for the HTTP Server connector. There is not much documentation on this platform and I would like to know how to Route the data from a Database Connector to an HTTP Server connector which will then display the data on a web page.

None of the Attributes in the WORK object are available to scripts in the DATA FLOW section.

数据流脚本

You need to update your question a little to reflect exactly what you want to do. Do you

  1. Want all the data from your SQL DB to be shown on every request that reaches your HTTP Server connector

  2. Display a specific entry from the DB depending on some input parameter on the request that reaches the HTTP Server connector ?

A little background on the feed and data flow sections

In your feed section, you would normally have a connector in iterator mode that will go through a number of data entries from a source.

In your data flow section you will have a number of connectors/functions/scripts that do transformations on the data

Each data entry that gets returned from the Iterator connector in the feed section, will go through the transformations described in the data flow section. This is configurable by mapping certain data attributes (columns in DB, fields in CSV, attributes in ldap, http parameters in http requests) to attributes in the work entry.

Normally it is up to you to do something with the transformed data, as in write them to a file, DB, ldap server.Again what will be written is configurable in the output map of the connector you use where you map attributes of the work entry to output attributes for the connector you use.

Now, the HTTP Server connector in Server mode is a slightly more complex beast in that it needs to send back a response to the HTTP client so it contains both an input map and an output map. What happens is that the request is read , the data flow section is executed and then the HTTP Server connector instance itself returns a reply to the HTTP client. This is described in detail here http://www-01.ibm.com/support/knowledgecenter/?lang=en#!/SSCQGF_7.1.0/com.ibm.IBMDI.doc_7.1/referenceguide29.htm%23serverconnect2 so I will not go into so much details.

Your specific scenario

If assumption 1 above is correct, then probably SDI is not the best tool for this. Or at least not as you plan to use it, anyway. You can have one assembly line that reads the data from the DB and then a file connector in AddOnly mode in your data flow (using an XML parser ) that will append the data in a specified form to a file. Then you need to do this once, or periodically, and serve the static html/xml file via a normal HTTP server. If you ABSOLUTELY need to use SDI for this, read below for assumption 2.

If assumption 2 is correct, then you have your connectors in the wrong sections. The HTTP Server connector needs to be in the feed section as this is the connector that would be listening all the time for incoming connections and would return something in response. The exact nature/Data of the response is up to you to decide by the connectors you will include in the Data Flow section. If you want to return a specific entry depending on the parameters of the request, then you would have a JDBC connector in lookup mode and the link criteria would be built based on the parameters of the incoming request in the HTTP Server. Otherwise, you need to read all the DB entries using the JDBC connector in lookup mode and a generic SQL query (select * from .. ) and then iterate over all the entries with a for-each attibute connector. No matter what/how you do it you will end up with some information you need to return to the client. For that you will use the output map of the HTTP Server connector and map the http.body and http.status

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM