on 01-15-2014 7:31 PM
Hello All,
As per design changes in one of our interfaces, some of receivers are now into sender for other receivers, so please tell me how to design this flow in PI.
File /File sender adapter ->PI->call JavaMap-->WS(Response payload)-->JDBC/sender or receiver adapter->PI-->Oracle/database(response)->PI->File adapter/receiver-->NFS folder
Here WS response was input for JDBC/Oracle and Oracle response was input for PI.
There is a little confusion in JDBC adapter/ looks ups need to use in this design, and also does it required BPM for make it one scenario?
Thanks for your time and let me know your design inputs.
Thanks,
Gayatri.
Hi.
Your flow will be as below.
File /File sender adapter(requestresponsebean) ->call JavaMap-->WS(Response payload)-->Graphical mapping with DB Lookup ->File adapter/receiver-->NFS folder
Regards
Venkat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gayatri
Your requirement can be done in one scenario and using without BPM. Below is the way
Scenario : File ( sender ) ---PI ---File receiver
Create java mapping where the input will be the data from file and output will be web service response.
You have use soap look up inside the java mapping. You need to create a SOAP receiver channel fro the same.
Create one graphical mapping where input will be the output of Java mapping and output will be the response from data base.You need to perform JDBC look up inside graphical map. You need to create a receiver JDBC channel to connect to the data base.
Create one operation mapping and use both the mapping in below order
java map
graphical map
Let me know if any issues.
Hi ,
If you want your design as below ,then you need request response bean in sender file channel because File is asynchronous .
File(request response bean)-->Java Mapping-->SOAP-->Mapping(d/b Look up)-->File
If you want to go as below ,yes request response bean not required ,based on your requirement and complexity choose the apt one.
File-->Java Mapping (SOAP lookup)-->Graphical Mapping (d/b Look up) -->File
or
File-->Mapping (SOAP Lookup,d/b look up) -->File
Regards
Venkat
Hi Indrajit,
You steps looks like simple, but didn't get clearly.
Mine was REST webservice its not SOAP webservice,
The 1st call we did successfully, thru java map(hard coded input values) we are invoked the REST service and getting the response back,when I click the TEST tab in OM, java map calling that service and giving the results values in right side.
2nd Step we need to handle :- I need to took some of the values from this response and send it to Oracle, where I got struck. Bit confusion for handle this step? can you tell me details steps to send this response to oracle? I have Oracle table structure which will receive the Input. Mean time I'll try to understand the DBlookups process.
I am looking for DT/MT/MM/OM details for send the RESTService response to Oracle.
Once I am able to hit the Oracle database and get the response back then I'll go for 3rd step for file receiver.
Thanks,
Gayatri
Thanks Venkat!
Mine was REST webservice its not SOAP webservice,
The 1st call we did successfully, thru java map(hard coded input values) we are invoked the REST service and getting the response back,when I click the TEST tab in OM, java map calling that service and giving the result values in right side.
2nd Step we need to handle :- I need to took some of the values from this response and send it to Oracle, where I got struck. Bit confusion for handle this step? can you tell me details steps to send this response to oracle? I have Oracle table structure which will receive the Input. Mean time I'll try to understand the DBlookups process.
I am looking for DT/MT/MM/OM details for send the RESTService response to Oracle.
Once I am able to hit the Oracle database and get the response back then I'll go for 3rd step for file receiver.
Thanks,
Gayatri
Hello,
>> I need to took some of the values from this response and send it to Oracle,
So what exactly u r doing in oracle DB - update/insert or just looking for entries and getting back the response?
Just a word of caution - DB lookup should not be used for insert/update opeartions. It's a bad practice.
Now coming to ur question, i believe the response from Rest WS will always come in a predefined kind of structure, so in that case create a intermediate structure for WS response. And then ur second mapping will be :
WS Response Intermediate Structure - PI (DB lookup) - File.
Thanks
Amit Srivastava
Thank you Very much Amit .Your inputs giving me some more clarity.
I am looking for entries (select query) and getting back the response which I need to send it to file.
Right now I am trying to do :Take some field/data from WS response and send it to Oracle DB.
For ex : I use to get the User id and other details from WS response,. I'll take only User IDs from this response and send it to Oracle database and fetch the all details of those UserIds.
and after send these Oracle Response to File
Yes your correct, the REST service response coming like Plain(structure) XML/Http string in OM :
<string xmlns="http://schemas.microsoft.com/2003/15/Normalization/"><?xml version="1.0" encoding="utf-8"?><PersonDetails><Person ID="19"><USER>20000</USER><Group>sdfsdfsfsdfsd</Group></Person></PersonDetails></string>
I need to create structure for above response (DT/MT) and SI was OB_Async? right?
Thanks,
Gayatri
Hello,
>>I need to create structure for above response (DT/MT) and SI was OB_Async? right?
No, for intermediate structure only create DT and MT(no need for SI) that will be similar to ur WS response structure.
So in all u will have 2 mappings:
1) one obviously is java mapping
2) And the second one will be message mapping i.e. MT_Intermediate - PI - Receiver File
And eventually under OM u will add both java mapping followed by message mapping.
Thanks
Amit Srivastava
Yes. You need to create a DT,MT
Operation Mapping:
Create one operation mapping - your sender SI is the file and the target SI would be the final File.
Inside the interface mapping you'll select your java mapping first and then a graphical mapping
Graphical Mapping:
source would be the responce of your WS and target would be the final file.
Inside the mapping, you'll do a JDBC lookup.(hope you have gone though the above provided blog for DBlookup)
Let me know if anything is unclear.
One suggestion - u can parse ur response which is coming from WS and instead of above structure try to output below str from JM:
<?xml version="1.0" encoding="utf-8"?>
<PersonDetails>
<Person ID="19">
<USER>20000</USER>
<Group>sdfsdfsfsdfsd</Group>
</Person>
</PersonDetails>
and then ur Intermediate structure can easily be created for above response message
Thanks for your responses!
Trying to create the Intermediate structure(DT/MT) according to WS response like above, but in PI name space is additional tag which is not matched exact to structure of WS response. That is the issue now, so how to avoid/trim this name space in PI or do I need to add this name space along with output structure in java map/ code? There are some trail and errors trying at this time, but pls. let me know which way is better and easy to handle?
WS response structure like below :
----------------------
<?xml version="1.0" encoding="utf-8"?>
<PersonDetails>
<Person ID="19">
<USER>20000</USER>
<Group>sdfsdfsfsdfsd</Group>
</Person>
</PersonDetails>
PI DT/MT structure for above structure:
----------------
<?xml version="1.0" encoding="UTF-8"?>
<ns0:PersonDetails xmlns:ns0="http://xxxxxxx.com/javamap/restservice">
<Person ID="19">
<USER></USER>
<Group></Group>
</Person>
</ns0:PersonDetails>
Thanks,
Gayatri
Hi Gayathri,
For d/b look .Below is the process .
1st step: Create a communication channel between PI and the database to connect to database.
2nd step :Import the d/b table definition in PI as external definition.
Create Object-->Interface Objects-->External Definition-->select category as dbtab-->
Communication channel/Click on import external definitions-->Continue-->select your communication component,Receiver JDBS channel -->continue -->finish.
3rd step :Use the above table definition in message mapping where this lookup is to be used by selecting JDBC Look up under Conversions and map and then
4th step :In message mapping go to signature tab and define the parameter as "channel" and category as "JDBC Adapter Type".
5th step:Under Operation mapping define the parameter and associate it with parameter defined in Message Mapping.
Regards
Venkat
Thanks Amit,
Looks like it worked, exact structure was not showing any error at level of OM test. You saved some of my time for not putting lack of my java skills.
While I doing this step , got one question?
How WS response values going into at the time of Message mapping between Intermediate_MT(DBLookup) to File_MT? Does OM will takecare this step?
Still I need to work for receiving WS response values and populate in structure at OM TEST/RESULTS TAB , this is pending in Java code/map.
Thanks again.
Gayatri.
Hello,
>>Does OM will takecare this step?
Yes, OM will take care of that. To be precise u have created intermediate structure just to ease out ur second mapping program - that's it.
So at runtime ur JM will return WS response, and it will automatically feed the intermediate structure and provide input for ur message mapping.
And eventually, during E2E execution u will only see structures which are generated before (source file structure) and after mapping(target file structure).
Thanks
Amit Srivastava
Message was edited by: Amit Srivastava
Thanks Again!
2 more questions, sorry bothering you all again.
My current requirements got changed, Its looks like I need to retrieve more User ids from different groups and along with recursive calls to find other details, so my WS response sends single XML/String contains nested tree structures with different group of User values. This output structure from WS may vary each call to WS.
How do I handle these different structures in Java map/Code which are dynamically change? the current one is hardcoded in Java map/code, which I treated as fixed structure, but now they changed.
According to WS response structure, I build intermediate _MT structure and working fine at this time. But is there any way to change my Intermediate_MT structure dynamically based on WS response structure at run time?
or let me know is there any feasible solutions strike in your mind for above challenges?
Thanks,
Gayatri.
When you say different use groups and different values, it's just that you receive multiple details or the strcture itself is not known?
I mean existing responce:
<PersonDetails>
<Person ID="19">
<USER>20000</USER>
<Group>sdfsdfsfsdfsd</Group>
</Person>
</PersonDetails>
different groups and user the responce would be :
<PersonDetails>
<Person ID="19">
<USER>20000</USER>
<Group>sdfsdfsfsdfsd</Group>
</Person>
</PersonDetails>
<PersonDetails>
<Person ID="20">
<USER>20001</USER>
<Group>sdfsdfsfsdfsd</Group>
</Person>
</PersonDetails>
<PersonDetails>
<Person ID="21">
<USER>20002</USER>
<Group>sdfsdfsfsdfsd</Group>
</Person>
</PersonDetails>
<PersonDetails>
<Person ID="22">
<USER>20002</USER>
<Group>sdfsdfsfsdfsd</Group>
</Person>
</PersonDetails>
If this is the case then you can change the occurence of PersonDetails to 0..unbounded and you should be good.
If this is not the ws responce, please provide sample xml
Thanks Hareesh!
At this point structure is not known.
I am changing the Java code according to new Input parameters to call WS, after multiple calls with different parameters might give the approximate output structures from WS.
I am expecting different USER groups with different User values like you said above?
Will let you know ,thanks again.
Hello,
>>This output structure from WS may vary each call to WS.
So u mean to say that everytime WS returns data in a different format?
BTW, u always enquire DB using user id and group?
If yes then parse the dynamic response and create a XML structure (having userid and group) from JM similar to what u have defined in PI and then may be u can still use MM...
Thanks
Amit Srivastava
You should be good as long as you just get multiple user details.
But if the responce strcture is not same, then i'm afriad it becomes very complex
Possible option i see if the response strcuture not consistent :
You might have to handle the DB look up also in the java mapping then without any graphical mapping you can pass the file to target(if there is no tarnsformation)
simillar discussion :
Once I test this java map then I could estimate what kind of output structures coming out from WS, I guess WS will sends different structures according to input parameters.
But the DB look up always based on USER only, I need to pass all group User ids to DB and fetch the full details of USERs.
I need at lease one round of testing using JM. so that i'll get clarity how WS responding.
Will let you know. Thanks again.
Hi,
>>Does OM will takecare this step?
Yes, OM will take care of that. To be precise u have created intermediate structure just to ease out ur second mapping program - that's it.
So at runtime ur JM will return WS response, and it will automatically feed the intermediate structure and provide input for ur message mapping.
And eventually, during E2E execution u will only see structures which are generated before (source file structure) and after mapping(target file structure).
When you say automatically feed the WS response into Intermediate structure?
It means E2E time? because I just tested Javamap at OM level and getting the response back from WS at Results side , but when I open message map in below java map, I do not see any data feed into Intermediate structure ?
What was the reason?
Thanks,
Hello,
Ideally u should see the target File structure (instead of JM response) in result view of OM test tab becoz at runtime ur JM and MM will be executed sequentially.
Anyway, what u can do is take the JM response and test ur message mapping and see if u are getting correct output or not?
Thanks
Amit Srivastava
Hi Gayatri - Not sure if you can call a VIEW using DBlookup.
The other appoach i can think of is..
Create a stored procedure in which you can call this view.
Execute that procedure using a UDF from the graphical mapping to fetch the data.
something like this
But please wait for experts comments to see if you can call a oracle VIEW using JDBC lookup.
Hi ,
As above said you don't require a BPM in your scenario.In sender file channel use RequestResponse bean .
Go through below link for steps to use.
Regards
Venkat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gayatri,
you have below scenario
schenario
1) File /File sender adapter ->PI->call JavaMap-->WS(request)
2) WS response -->->PI-->JDBC receiver adapter
3) Oracle/database(response)->PI->File adapter/receiver in NFS folder
If you have sync call to WS then you need BPM to handle the response.
regards,
Harish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gayatri -I don't think you need a BPM.
You can make use of the JDBC Lookup function to request the database operation&get the responce . Map the responce to File adapter strcuture.
Like below if i understand your scenario correctly
File /File sender adapter ->PI->call JavaMap-->WS(Response payload)-->Graphical mapping with DB Lookup ->File adapter/receiver-->NFS folder
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gayatri - You can refer to below Document for DB lookup
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.