Author |
Message
|
harsha8127 |
Posted: Tue Feb 02, 2016 11:17 pm Post subject: Message constructoin |
|
|
Acolyte
Joined: 25 Nov 2013 Posts: 72
|
Hi docs,
Iam new to WMB working in a project dealing with webservices.
I have developed a WSDL using XSD's. I have developed my basic flow with
""Saop inputnode---Computnode----MQoutputNode."" followed by remainnig nodes.From MQ output node I have to transmit data across AS400 systems using MQSeries. I have constructed the mapping in compute node using ESQL code.
CREATE COMPUTE MODULE Reinstatement_AmountFlow_Compute
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
DECLARE A INTEGER 1;
DECLARE B INTEGER 2;
DECLARE IO REFERENCE TO OutputRoot.XMLNSC.ns:ReinstatementAmount;
IF A < B THEN
SET IO.Leader_x0020_Header_x0020_Information.MSGREFNO = InputRoot.XMLNSC.ns14:ReinstatementAmount.TransactionId;
SET IO.Leader_x0020_Header_x0020_Information.USRPRF = 'LA7USER1 ';
SET IO.Leader_x0020_Header_x0020_Information.WKSID = 'ITRM12 ';
SET IO.Leader_x0020_Header_x0020_Information.OBJID = 'LAPRNSTBO ';
SET IO.Leader_x0020_Header_x0020_Information.VRBID = 'LAPRNSTQT ';
SET IO.Leader_x0020_Header_x0020_Information.TOTMSGLNG = '00140';
SET IO.Leader_x0020_Header_x0020_Information.OPMODE = '1';
SET IO.Leader_x0020_Header_x0020_Information.CMTCONTROL = 'Y';
SET IO.Leader_x0020_Header_x0020_Information.RSPMODE = 'I';
SET IO.Leader_x0020_Header_x0020_Information.MSGINDENT = 'R';
SET IO.Leader_x0020_Header_x0020_Information.MORE_IND = 'N';
SET IO.Leader_x0020_Header_x0020_Information.ERRLVL = 'O';
SET IO.Leader_x0020_Header_x0020_Information.FILLER = ' ';
SET IO.SESSIONMessageHeader.MSGID = 'SESSIONI ';
CREATE NEXTSIBLING OF OutputRoot.Properties DOMAIN 'MQMD';
SET OutputRoot.MQMD.Version = MQMD_CURRENT_VERSION;
SET OutputRoot.MQMD.MsgType = MQMT_DATAGRAM;
SET OutputRoot.MQMD.Format = 'MQHRF2';
endif...
While puting the message to MQ queue the msg formationi is not happening and a blank msg is comming. Does the msg construction is wrong in my code or any other thing (code) should be added to my code..
thanks in advance.
 |
|
Back to top |
|
 |
manoj5007 |
Posted: Wed Feb 03, 2016 12:03 am Post subject: |
|
|
 Acolyte
Joined: 15 May 2013 Posts: 64
|
Hi Harsha,,
The reference IO pointing to must exist, place create the XMLNSC.ns:ReinstatementAmount Field using CreateField and then declare the reference. As the field ReinstatementAmount doesn't exist IO will point to OutputRoot, as this is the default property of Reference type.
This should solve the problem of blank msg |
|
Back to top |
|
 |
timber |
Posted: Wed Feb 03, 2016 12:07 am Post subject: |
|
|
 Grand Master
Joined: 25 Aug 2015 Posts: 1292
|
What steps have you already taken to debug this ( so that we don't tell you to do things that you have already done) ?
Have you received any error messages? If so, please quote them. |
|
Back to top |
|
 |
maurito |
Posted: Wed Feb 03, 2016 12:10 am Post subject: |
|
|
Partisan
Joined: 17 Apr 2014 Posts: 358
|
|
Back to top |
|
 |
harsha8127 |
Posted: Wed Feb 03, 2016 1:31 am Post subject: |
|
|
Acolyte
Joined: 25 Nov 2013 Posts: 72
|
manoj5007 wrote: |
Hi Harsha,,
The reference IO pointing to must exist, place create the XMLNSC.ns:ReinstatementAmount Field using CreateField and then declare the reference. As the field ReinstatementAmount doesn't exist IO will point to OutputRoot, as this is the default property of Reference type.
This should solve the problem of blank msg |
Hi monoj,
thanks for your reply, iam sorry i did not understand what u said,please if you dnt mind can you please explain. |
|
Back to top |
|
 |
maurito |
Posted: Wed Feb 03, 2016 1:35 am Post subject: |
|
|
Partisan
Joined: 17 Apr 2014 Posts: 358
|
harsha8127 wrote: |
manoj5007 wrote: |
Hi Harsha,,
The reference IO pointing to must exist, place create the XMLNSC.ns:ReinstatementAmount Field using CreateField and then declare the reference. As the field ReinstatementAmount doesn't exist IO will point to OutputRoot, as this is the default property of Reference type.
This should solve the problem of blank msg |
Hi monoj,
thanks for your reply, iam sorry i did not understand what u said,please if you dnt mind can you please explain. |
Use the LASTMOVE function after the DECLARE IO statement, that will help you understand what is wrong.
http://www-01.ibm.com/support/knowledgecenter/SSMKHH_9.0.0/com.ibm.etools.mft.doc/ak04864_.htm?lang=en |
|
Back to top |
|
 |
harsha8127 |
Posted: Wed Feb 03, 2016 2:46 am Post subject: |
|
|
Acolyte
Joined: 25 Nov 2013 Posts: 72
|
Thnaks for you suggestions , now i have removed the reference fields.
now while the output is cumming as xml msg, which i have to convert into flatfile fixed length msg. shud i write any code or add a compute node in which i have to parse the mesaage. |
|
Back to top |
|
 |
maurito |
Posted: Wed Feb 03, 2016 3:02 am Post subject: |
|
|
Partisan
Joined: 17 Apr 2014 Posts: 358
|
harsha8127 wrote: |
Thnaks for you suggestions , now i have removed the reference fields.
now while the output is cumming as xml msg, which i have to convert into flatfile fixed length msg. shud i write any code or add a compute node in which i have to parse the mesaage. |
So, if you want the message to be a stream, why are you creating it as XML to start with and not directly ?
I think you probably need to talk to your manager/team leader and ask for some formal education. |
|
Back to top |
|
 |
akkypaul |
Posted: Wed Feb 03, 2016 4:09 am Post subject: |
|
|
 Apprentice
Joined: 30 Jun 2014 Posts: 44 Location: India
|
In order to write the output to a flat file,
-> Use the ASBITSTRAM function to convert it into a BLOB and then and then -> Use CAST Function to convert it the BLOB message to CHARACTER form.
-> Following statement can help you:-
CREATE FIELD OutputRoot.BLOB;
SET OutputLocalEnvironment.Wildcard.WildcardMatch = FileName;
SET OutputRoot.BLOB.BLOB = CAST(envRef.FileData AS BLOB CCSID 1208);
-> The File Output Node has two input terminals.
-> Connect both the input terminals to the output of Compute node |
|
Back to top |
|
 |
Vitor |
Posted: Wed Feb 03, 2016 5:32 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
akkypaul wrote: |
In order to write the output to a flat file,
-> Use the ASBITSTRAM function to convert it into a BLOB and then and then -> Use CAST Function to convert it the BLOB message to CHARACTER form.
-> Following statement can help you:-
CREATE FIELD OutputRoot.BLOB;
SET OutputLocalEnvironment.Wildcard.WildcardMatch = FileName;
SET OutputRoot.BLOB.BLOB = CAST(envRef.FileData AS BLOB CCSID 1208);
-> The File Output Node has two input terminals.
-> Connect both the input terminals to the output of Compute node |
The OP seems quite clear that it's required to use MQ to transmit the data, and even used an MQOutput node.
Read the whole thread before offering the wrong advice. It's the wrong advice because the OP was clear that he wanted a flat file format not a character string of XML, so DFDL is the mechanism needed to serialize & convert it. Even if the OP did want the XML as a string, there's no need to convert it to a BLOB as you describe.
Any more than there's any requirement to stage the file data in the Environment tree as your code indicates. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
maurito |
Posted: Wed Feb 03, 2016 6:51 am Post subject: |
|
|
Partisan
Joined: 17 Apr 2014 Posts: 358
|
[color=red]
Vitor wrote: |
akkypaul wrote: |
In order to write the output to a flat file,
-> Use the ASBITSTRAM function to convert it into a BLOB and then and then -> Use CAST Function to convert it the BLOB message to CHARACTER form.
-> Following statement can help you:-
CREATE FIELD OutputRoot.BLOB;
SET OutputLocalEnvironment.Wildcard.WildcardMatch = FileName;
SET OutputRoot.BLOB.BLOB = CAST(envRef.FileData AS BLOB CCSID 1208);
-> The File Output Node has two input terminals.
-> Connect both the input terminals to the output of Compute node |
The OP seems quite clear that it's required to use MQ to transmit the data, and even used an MQOutput node.
Read the whole thread before offering the wrong advice. It's the wrong advice because the OP was clear that he wanted a flat file format not a character string of XML, so DFDL is the mechanism needed to serialize & convert it. Even if the OP did want the XML as a string, there's no need to convert it to a BLOB as you describe.
Any more than there's any requirement to stage the file data in the Environment tree as your code indicates. |
That is what the OP will get if he/she does not bother to read the docs and/or do some proper education. Most people in this forum are well intentioned and give honest advice, but that does not mean it is the correct one. Using the forum for learning purposes is the wrong thing to do. |
|
Back to top |
|
 |
akkypaul |
Posted: Wed Feb 03, 2016 7:51 am Post subject: |
|
|
 Apprentice
Joined: 30 Jun 2014 Posts: 44 Location: India
|
Using the form for learning is a wrong thing to do?
I do not follow.
I just tried to help them out with what I could.
It is, at least, better than nothing.
All the replies above just asked questions and told them to alter the entire mechanism. Maybe it's their requirement to do it this way.
In any case, it seems like you guys are the masters here and I expected better replies and REAL help as a reply.
But I am glad I should serve as an entertainer.
Cheers!
 |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Feb 03, 2016 8:07 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
There's a difference between learning and training.
The forum is great for learning, bad for training. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
Vitor |
Posted: Wed Feb 03, 2016 8:10 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
akkypaul wrote: |
Using the form for learning is a wrong thing to do?
I do not follow. |
We're not a training resource and are simply not equipped to be. We exist as a group to offer advice on specific questions. Attempting to get actual training from a bunch of unaccountable part time strangers is not only a road to pain and misery, you end up with a poor result.
akkypaul wrote: |
I just tried to help them out with what I could.
It is, at least, better than nothing. |
No, it wasn't better than nothing. It was not good code nor was it in line with IIB best practices. The problem is that inexperienced personnel (like the OP) will be misled by this and go down a rabbit hold.
akkypaul wrote: |
All the replies above just asked questions and told them to alter the entire mechanism. |
We ask questions because we can't see the OP's screen. I don't see any point where we said to change "the entire mechanism" - you were the one who suggested moving from MQ to Files.
akkypaul wrote: |
Maybe it's their requirement to do it this way. |
I'm guessing that their requirement is to do it the way the OP posted they wanted to do it; i.e. over MQ.
akkypaul wrote: |
In any case, it seems like you guys are the masters here and I expected better replies and REAL help as a reply. |
There was real help. We can't write the OPs code for them
akkypaul wrote: |
But I am glad I should serve as an entertainer. |
Bad advice is not entertaining. And I'm the comic relief. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
harsha8127 |
Posted: Wed Feb 03, 2016 9:54 pm Post subject: |
|
|
Acolyte
Joined: 25 Nov 2013 Posts: 72
|
akkypaul wrote: |
In order to write the output to a flat file,
-> Use the ASBITSTRAM function to convert it into a BLOB and then and then -> Use CAST Function to convert it the BLOB message to CHARACTER form.
-> Following statement can help you:-
CREATE FIELD OutputRoot.BLOB;
SET OutputLocalEnvironment.Wildcard.WildcardMatch = FileName;
SET OutputRoot.BLOB.BLOB = CAST(envRef.FileData AS BLOB CCSID 1208);
-> The File Output Node has two input terminals.
-> Connect both the input terminals to the output of Compute node |
Thanks Akkypaul for ur valuable reply's,
I need to put the output to MQ output Node as fixed length (00001234LA7USER1 ITRM12 LAPRNSTBO LAPRNSTQT 001401YIRN0 SESSIONI 0001000001 210E000000LAPLAPQTI 0001000001 00781076 ) not to the file node.
Now i have created a output msg set also and i my looks like
SET OutputRoot.MRM.Leader_Header.MSGREFNO = InputRoot.XMLNSC.ns:ReinstatementAmount.TransactionId;
SET OutputRoot.MRM.Leader_Header.USRPRF = 'LA7USER1 ';
SET OutputRoot.MRM.Leader_Header.WKSID = 'ITRM12 ';
SET OutputRoot.MRM.Leader_Header.OBJID = 'LAPRNSTBO ';
SET OutputRoot.MRM.Leader_Header.VRBID = 'LAPRNSTQT ';
SET OutputRoot.MRM.Leader_Header.TOTMSGLNG = '00140';
SET OutputRoot.MRM.Leader_Header.OPMODE = '1';
SET OutputRoot.MRM.Leader_Header.CMTCONTROL = 'Y';
SET OutputRoot.MRM.Leader_Header.RSPMODE = 'I';
SET OutputRoot.MRM.Leader_Header.MSGINDENT = 'R';
SET OutputRoot.MRM.Leader_Header.MORE_IND = 'N';
SET OutputRoot.MRM.Leader_Header.ERRLVL = 'O';
SET OutputRoot.MRM.Leader_Header.FILLER = ' ';
SET OutputRoot.MRM.SESSION_Message_Header.MSGID = 'SESSIONI ';
SET OutputRoot.MRM.SESSION_Message_Header.MSGLNG = '00010';
SET OutputRoot.MRM.SESSION_Message_Header.MSGCNT = '00001';
SET OutputRoot.MRM.SESSION_Message_Header.FILLER = ' ';
SET OutputRoot.MRM.SESSION_Message_Data.COMPANY = '2';
SET OutputRoot.MRM.SESSION_Message_Data.BRANCH = '10';
SET OutputRoot.MRM.SESSION_Message_Data.LANGUAGE = 'E';
SET OutputRoot.MRM.SESSION_Message_Data.ACCTYR = '0000';
SET OutputRoot.MRM.SESSION_Message_Data.ACCTMN = '00';
SET OutputRoot.MRM.SESSION_Message_Header.MSGID = 'LAPLAPQTI ';
SET OutputRoot.MRM.SESSION_Message_Header.MSGLNG = '00001';
SET OutputRoot.MRM.SESSION_Message_Header.MSGCNT = '00001';
SET OutputRoot.MRM.SESSION_Message_Header.FILLER = ' ';
SET OutputRoot.MRM.Message_data.CHDRSEL = InputRoot.XMLNSC.ns:ReinstatementAmount.ContractNumber;
CREATE NEXTSIBLING OF OutputRoot.Properties DOMAIN 'MQMD';
SET OutputRoot.MQMD.Version = MQMD_CURRENT_VERSION;
SET OutputRoot.MQMD.MsgType = MQMT_DATAGRAM;
SET OutputRoot.MQMD.Format = MQFMT_RF_HEADER_2 ;
SET OutputRoot.MRM = InputRoot.XMLNSC;
END IF;
RETURN;
While debugging point to point after compute node itz not reaching the mqoutput node it is searching for source (Source not found.
Not able to find what is the error
 |
|
Back to top |
|
 |
|