Menu
- General Information
- Architecture :
- Services & Processes
- CookBooks
- Deployment
- Bundled Applications
- Source Code :
- Third-Party Setup :
- Polytech Staff Area :
InfoProvider is a special orchestration of Web Services inside jSeduite. This orchestration collects all expected informations from the jSeduite services pool, and then return it to the client in a standardized way.
Inside a jSeduite bundle, the InfoProvider is the keystone of the information broadcasting process. Each bundle defines its own InfoProvider, as the broadcasting process is different for each targeted academic institution.
This page is a cookbook to make your life easier when you want to define your own InfoProvider (and so, your own jSeduite bundle). Follow the guidelines and build your own information broadcasting system in a really short time !
The InfoProvider process follows a well-known pattern. We implement this pattern as a BPEL process in the InfoProviderSkel project.
This project is architectured as the following:
InfoProvider.xsd: Information Data Model, Request & Response Message definitionInfoProvider.wsdl: Public contract to exchange message with the real worldInfoProvider.bpel: the BPEL process skeleton (sou you 'just' fill in the blank as when you were in junior school…)TechPartners: Contains public WSDL contracts, data models & wrappers for technical partners (account management, preferences & error logging)Sources: This empty folder will contain information sources WSDL contracts, datamodels & wrappers for the source you're going to compose.The BPEL process skeleton also defines the following variables:
user: the given login (xsd:string) read from the input message password: the given password (xsd:string, plain text) read from the input messageisAuthorized operation.result: a tns:ArrayOfInformation which is returned by the process when sending response.
To retrieve the skeleton, copy/paste the InfoProviderSkel Process Files content. Do not forget to retrieve the catalog.xml file content (a premature end of file exception will be throw if you've forgot to copy it).
In order to avoid namespace conflicts and other XML stuff, you'll need to customize the InfoProvider.* file to define your own process.
If you skip this step, you'll define an Infoprovider using the skel namespace (by the way, it's not a good idea to skip this step …)
InfoProvider.xsd: xmlns:tns and the targetNamespace xsd:schema attributes, replacing skel with your institution name for example (eg epu): <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://modalis.polytech.unice.fr/jSeduite/schema/InfoProvider/epu" xmlns:tns="http://modalis.polytech.unice.fr/jSeduite/schema/InfoProvider/epu" elementFormDefault="qualified">
InfoProvider.wsdl: definitions node by changing the following attributes (replace skel by your institution name): targetNamespace, xmlns:tns & xmlns:ns <definitions name="InfoProvider" targetNamespace="http://modalis.polytech.unice.fr/jSeduite/wsdl/InfoProvider/epu" xmlns:tns="http://modalis.polytech.unice.fr/jSeduite/wsdl/InfoProvider/epu" xmlns:ns="http://modalis.polytech.unice.fr/jSeduite/schema/InfoProvider/epu" >
xsd:schema node and perform the same change on the targetNamespace. Do not forget to change the namespace of the xsd:import node defined inside: <xsd:schema targetNamespace="http://modalis.polytech.unice.fr/jSeduite/wsdl/InfoProvider/epu"> <xsd:import namespace="http://modalis.polytech.unice.fr/jSeduite/schema/InfoProvider/epu" schemaLocation="InfoProvider.xsd"/> </xsd:schema>
Validate XML Button, you must have the following output inside your Netbeans XML check window: XML validation started. 0 Error(s), 0 Warning(s). XML validation finished.
InfoProvider.bpel: process node, replacing skel with your institution name: targetNamespace, tns & xmlns:ns0. <process targetNamespace="http://modalis.polytech.unice.fr/jSeduite/bpel/InfoProvider/epu" xmlns:tns="http://modalis.polytech.unice.fr/jSeduite/bpel/InfoProvider/epu" xmlns:ns0="http://modalis.polytech.unice.fr/jSeduite/schema/InfoProvider/epu">
import node for the WSDL & XSD files, and replace skel by your institution name: <import namespace="http://modalis.polytech.unice.fr/jSeduite/wsdl/InfoProvider/epu" location="InfoProvider.wsdl" importType="http://schemas.xmlsoap.org/wsdl/" /> <import namespace="http://modalis.polytech.unice.fr/jSeduite/schema/InfoProvider/epu" location="InfoProvider.xsd" importType="http://www.w3.org/2001/XMLSchema" />
partnerLink named external and replace skel by … guess what … your institution name: <partnerLink name="external" xmlns:tns="http://modalis.polytech.unice.fr/jSeduite/wsdl/InfoProvider/epu" partnerLinkType="tns:InfoProvider" myRole="InfoProviderPortTypeRole"/>
GetInformationIn & GetInformationOut variable node to replace skel value: <variable name="GetInformationOut" xmlns:tns="http://modalis.polytech.unice.fr/jSeduite/wsdl/InfoProvider/epu" messageType="tns:GetInformationResponse"/> <variable name="GetInformationIn" xmlns:tns="http://modalis.polytech.unice.fr/jSeduite/wsdl/InfoProvider/epu" messageType="tns:GetInformationRequest"/>
receive activity (in the sequence named reception) and change the xmlns:tns attribute: <receive name="receive" createInstance="yes" partnerLink="external" operation="GetInformation" xmlns:tns="http://modalis.polytech.unice.fr/jSeduite/wsdl/InfoProvider/epu" portType="tns:InfoProviderPortType" variable="GetInformationIn"/>
reply activity in the response sequence: <reply name="reply" partnerLink="external" operation="GetInformation" xmlns:tns="http://modalis.polytech.unice.fr/jSeduite/wsdl/InfoProvider/epu" portType="tns:InfoProviderPortType" variable="GetInformationOut"/>
XML check validation should return 2 warnings (it's normal):XML validation started. $JESDUITE_HOME/providers/InfoProviderSkel/src/InfoProvider.bpel:26,8 WARNING: The variable "globalIndex" is initialized and not used. $JSEDUITE_HOME/providers/InfoProviderEPU/src/InfoProvider.bpel:28,8 WARNING: The variable "authorized" is initialized and not used. $JSEDUITE_HOME/providers/InfoProviderEPU/src/InfoProvider.bpel:74,16 WARNING: The types of "From" and "To" activities are different: "string" and "InformationSet". 0 Error(s), 2 Warning(s). XML validation finished.
globalIndex integer variableauthorized variable result variable. xml literal assignment. so we're using an ugly hack to perform the initialization (forcing the empty string as node content will enforce the node initialization).If your process validate with these two warnings, you're done with the namespace customization !
remote WSDL importation mechanism. It create a (bloody) mess inside the Sources folders, and you'll loose your marbles in a very short time. Always use the local WSDL importation mechanism.
Sources folder, and choose the New / External WSDL Document(s) menu itemFrom Local File System radio button (cf previous warning), and choose the WSDL file you've just downloadedcamelCase name (rssreaderservice.wsdl != RssReaderService.wsdl).finish button.wsdl file on the right side of the BPEL Process, under the others orchestration partnerspartnerLinkName (and role if asked to) related to the source of information you're adding (for the CacheRssReader partner, use feedreader instead of PartnerLink1).
catalog.xml files as the refactoring process in Netbeans 6.5 doesn't handle it properly.
You need to enhance the InfoProvider.xsd data model to handle properly the new source of information:
RssReaderService.xsd for the CachedFeedReader source): <xsd:import schemaLocation="Sources/RssReaderService.xsd" namespace="http://feeds.technical.jSeduite.modalis.i3s.unice.fr/"/>
Information choice to handle this kind of data as business object: <xsd:complexType name="Information"> <xsd:choice> <!-- others available kinds of information --> <xsd:element name="feedContent" type="ns2:feedContent"/> </xsd:choice> <xsd:attribute name="kind" type="xsd:string"/> </xsd:complexType>
DataTypeSet complex type to handle collections of informations: <xsd:complexType name="FeedContentSet"> <xsd:sequence> <xsd:element name="item" type="ns2:feedContent" maxOccurs="unbounded" minOccurs="0"/> </xsd:sequence> </xsd:complexType>
We need to add a global variable in the BPEL Process InfoProvider.bpel to collect all informations from this new source:
<variable name="feed_reader_result" type="ns0:FeedContentSet"/>
If the source of information use input parameters, you'll have to enrich the database with the adequate call informations.
sources relation: INSERT INTO `sources` VALUES (Source_Id, WebService_Name, Operation_Name);
preferences relation (ie this login wants to subscribe to this source): INSERT INTO `preferences` VALUES (Preference_Id, Login, Source_Id);
messages relation the parameters values this login will use to perform a call: INSERT INTO `messages` VALUES (NULL, Preference_Id, Call_Id, Parameter_Name, Value);
Example: We consider here that we're adding the CachedFeedReader source. The user with login hall subscribes to this source, and expects to retrieve the content of two feeds (TV5_une & Antibes_tout) with a validity period of 30 minutes.
INSERT INTO `sources` VALUES (1, 'CachedFeedReader', 'read'); INSERT INTO `preferences` VALUES (1, 'hall', 1); INSERT INTO `messages` VALUES (NULL, 1, 1, 'validity', '30'); INSERT INTO `messages` VALUES (NULL, 1, 1, 'name', 'TV5_une'); INSERT INTO `messages` VALUES (NULL, 1, 2, 'validity', '30'); INSERT INTO `messages` VALUES (NULL, 1, 2, 'name', 'Antibes_tout');
Take a look at the commented first scope (named SourceName) inside the InfoProvider.bpel skeleton code. It implements the pattern of information retrieval for a given source.
SourceOperationOut & SourceOperationIn variableslog_pre: change the SourceName value in the message assignmentsilentIgnore: change the to part of the assignment to fit with you global variablegetCalls_pre: change the service and operation values to fit with your source.getParameter_ParamName sequence: getParameter_ParamName_pre: change service, operation and ParamName values.getParameter_ParamName_post: change $SourceOperationIn.in/ns:ParamName value.perform_call: change the attributes to fit with your data sourcefeedLocalResult: change global_variable_name value.
Do not hesitate to look the source code of existing providers ( like InfoProviderEpu, …) and inspire your development from those validated process.
Take a look at the second commented scope (named SourceName_Feed). This code will feed the global result with the source ones.
feed_loop: change the global_variable_name value in the conditionfeed_result: change the global_variable_name and the dataType value.
…