Author |
Message
|
zhaider |
Posted: Thu Oct 13, 2016 6:16 am Post subject: |
|
|
Apprentice
Joined: 08 Oct 2015 Posts: 40
|
That's exactly what I'm doing but it is not working. I encounter the problem I outlined in my original post. |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Oct 13, 2016 6:35 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
zhaider wrote: |
That's exactly what I'm doing but it is not working. I encounter the problem I outlined in my original post. |
Your original post talked about writing a parser.
I'm talking about using existing parsers and creating message models - an XML one and a DFDL one.
The XML one will parse your incoming message. The DFDL one will output your flat string without any tags. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
zhaider |
Posted: Thu Oct 13, 2016 6:48 am Post subject: |
|
|
Apprentice
Joined: 08 Oct 2015 Posts: 40
|
May be I worded it wrong. Can you show me how it's done with an example? |
|
Back to top |
|
 |
Vitor |
Posted: Thu Oct 13, 2016 6:54 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
zhaider wrote: |
Can you show me how it's done with an example? |
The samples are full of examples of mapping an input logical message tree to an output logical message tree. This is basic, basic stuff.
I think your problem is you're expecting this to be a lot more complex than it is. Nothing in what you've described sounds hard; as my associates point out, you're taking XML in (which is handled by the XMLNSC domain out of the box) and writing out a text string (which is handled by the DFDL domain out of the box).
If there's complexity you've failed to articulate it. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
zhaider |
Posted: Thu Oct 13, 2016 7:34 am Post subject: |
|
|
Apprentice
Joined: 08 Oct 2015 Posts: 40
|
Vitor wrote: |
zhaider wrote: |
Can you show me how it's done with an example? |
The samples are full of examples of mapping an input logical message tree to an output logical message tree. This is basic, basic stuff.
I think your problem is you're expecting this to be a lot more complex than it is. Nothing in what you've described sounds hard; as my associates point out, you're taking XML in (which is handled by the XMLNSC domain out of the box) and writing out a text string (which is handled by the DFDL domain out of the box).
If there's complexity you've failed to articulate it. |
Quote: |
I have requirement where I have to send a message to the TCPIP Server, I have already written a parser but the problem I'm facing is how to send it the message in string as is. I tried to send it by converting it into a byte[] through Java compute and then send it but Wirehsrak showed the message as a sequence of ASCII chars being passed in a sequence of XML tags. I don't want that. I want a string to pass as is without any tags. So, I tried to simply send a string but it won't even pass or work. |
This is what I originally asked and that is exactly what the problem is. I even attached the project upto the point where I'm getting the string to the JavaCompute node and gets a byte array and then passing it to a TCPIPNode. The problem is it sends the message as
<byteArray><myByte>20</myByte><myByte>30</myByte>....</byteArray>
Either show me how to pass the string that I'm sending inside the Compute Node as is to the TCPIPNode and receive a reply or if it's necesaary to send it in bytearray how can I do this? |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Oct 13, 2016 7:38 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
|
Back to top |
|
 |
Vitor |
Posted: Thu Oct 13, 2016 7:52 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
mqjeff wrote: |
Stop thinking about "strings" and "byte arrays". |
I thought I'd made that clear earlier. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
zhaider |
Posted: Thu Oct 13, 2016 8:04 am Post subject: |
|
|
Apprentice
Joined: 08 Oct 2015 Posts: 40
|
Okay, I think it's easy enough can some please make a sample application with TCPIP output node that both sends and receive a message from the XML content or just anything at all and one that is working? I just don't know how else I can explain it simply. |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Oct 13, 2016 8:33 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
mqjeff wrote: |
You use the XMLNSC parser to turn your input XML into a logical message tree.
You create a DFDL message description.
You map the XML logical message tree into the right fields in the DFDL logical message tree.
You send the DFDL logical message tree to the TCP node. |
Looks like it's a little bit more involved than that. If I understood his java transformation correctly he needs to prefix the (DFDL) string output with 2 bytes defining the length of the output...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Oct 13, 2016 8:37 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
fjb_saper wrote: |
mqjeff wrote: |
You use the XMLNSC parser to turn your input XML into a logical message tree.
You create a DFDL message description.
You map the XML logical message tree into the right fields in the DFDL logical message tree.
You send the DFDL logical message tree to the TCP node. |
Looks like it's a little bit more involved than that. If I understood his java transformation correctly he needs to prefix the (DFDL) string output with 2 bytes defining the length of the output...  |
I've forgotten if DFDL can do that.
Regardless, he or she can build the DFDL logical message tree, asbitstream it, get the length, prepend it. Then he or she is working with strings. But up to that point, working with logical message trees is the correct path. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Oct 13, 2016 8:43 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
What I was looking at and would work for the OP was following:
According to the project he shared...
- Create an XML model for the input message
- Change the Java snippet in his code to match requirements
- Capitalize the class name
- Add a character set into the transformation to byte array instead of defaulting to the platform one
- Move the class into a Java project of its own and reference that project in the main project
- Create a new map with BLOB output and map the string via the custom java transform to the BLOB.BLOB
Make sure the OutputRoot properties correctly define the CCSID and encoding of the output message.
- send the message as BLOB to the tcp node
Looking at the input message in the shared project the new map would replace his 2 maps.
Hope this clarifies what is needed here.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
zhaider |
Posted: Thu Oct 13, 2016 10:21 am Post subject: |
|
|
Apprentice
Joined: 08 Oct 2015 Posts: 40
|
fjb_saper wrote: |
mqjeff wrote: |
You use the XMLNSC parser to turn your input XML into a logical message tree.
You create a DFDL message description.
You map the XML logical message tree into the right fields in the DFDL logical message tree.
You send the DFDL logical message tree to the TCP node. |
Looks like it's a little bit more involved than that. If I understood his java transformation correctly he needs to prefix the (DFDL) string output with 2 bytes defining the length of the output...  |
That is correct!
Can you show me how to send it in BLOB like you said in your last post? |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Oct 13, 2016 11:42 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
zhaider wrote: |
Can you show me how to send it in BLOB like you said in your last post? |
I just mapped your custom Java transform to the BLOB-Blob.
When creating the map specify the output parser as BLOB...  _________________ MQ & Broker admin
Last edited by fjb_saper on Mon Oct 17, 2016 4:25 am; edited 1 time in total |
|
Back to top |
|
 |
zhaider |
Posted: Sun Oct 16, 2016 11:07 pm Post subject: |
|
|
Apprentice
Joined: 08 Oct 2015 Posts: 40
|
|
Back to top |
|
 |
|