ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » TCPIPClientOutput Node Usage

Post new topic  Reply to topic Goto page 1, 2  Next
 TCPIPClientOutput Node Usage « View previous topic :: View next topic » 
Author Message
zhaider
PostPosted: Sat Oct 08, 2016 12:41 am    Post subject: TCPIPClientOutput Node Usage Reply with quote

Apprentice

Joined: 08 Oct 2015
Posts: 40

Hi,

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.

Can someone show me a sample how to send a string over a TCIPClientOutNode from an XML and then receive the output in TCIPIPClient Receive node in a string?

Thanks.
Back to top
View user's profile Send private message
eammnsh
PostPosted: Sat Oct 08, 2016 3:17 am    Post subject: Reply with quote

Apprentice

Joined: 22 Aug 2016
Posts: 29

Hi,
Seems like you are using XMLNSC or XMLNS domain, you need to use DFDL or MRM to form your elements in any TEXT physical format you want.
Back to top
View user's profile Send private message
zhaider
PostPosted: Sun Oct 09, 2016 1:58 am    Post subject: Reply with quote

Apprentice

Joined: 08 Oct 2015
Posts: 40

Can you give me an example? Or link me to a sample? As far as I know I did define the DFDL parser.
Back to top
View user's profile Send private message
smdavies99
PostPosted: Sun Oct 09, 2016 1:42 pm    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

If you don't want to use delimiters to identify the STX and ETX of the data then you should send the length of the data in a fixed length message and then the data.
The receiver would read the fixed length part and extract the number of bytes to read from the TCP/IP stream and then use that as the length of data to read.

TCP/IP comms is not as straightforward as most people expect.

All the systems I've used the above solution use a 5 byte fixed length message.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
timber
PostPosted: Sun Oct 09, 2016 2:19 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1280

Quote:
I have already written a parser but the problem I'm facing is how to send it the message in string as is
Not sure that I understand - IIB has a wide range of built-in parsers so you should not need to write your own. What is this parser for?
Quote:
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.
I *think* I know what your problem is, but I don't want to make assumptions. Please explain the technical problem more fully. What task is the message flow performing? ( sending the contents of an XML tag to a TCPIP server?). What is in OutputRoot when you propagate it to the TCPIPClientOutput node?
Back to top
View user's profile Send private message
zhaider
PostPosted: Mon Oct 10, 2016 1:03 am    Post subject: Reply with quote

Apprentice

Joined: 08 Oct 2015
Posts: 40

timber wrote:
Quote:
I have already written a parser but the problem I'm facing is how to send it the message in string as is
Not sure that I understand - IIB has a wide range of built-in parsers so you should not need to write your own. What is this parser for?
Quote:
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.
I *think* I know what your problem is, but I don't want to make assumptions. Please explain the technical problem more fully. What task is the message flow performing? ( sending the contents of an XML tag to a TCPIP server?). What is in OutputRoot when you propagate it to the TCPIPClientOutput node?


Yes, I want to send the contents of an XML tag to a TCPIP server but I can't when I pass it as a string. It doesn't work at all. And when I send it as an array of bytes. This is how it passes through:

Code:

<byteStream>
<myByte>20</myByte>
<myByte>44</myByte>
.....
</byteStream>


The message I want to send is simple eg. AFGGSFGFSGHFSGGSFGHSFHSG which is the content of a certain XML tag.[/code]
Back to top
View user's profile Send private message
timber
PostPosted: Mon Oct 10, 2016 2:06 am    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1280

I think you're confused about how IIB works. Please post your code (leave out or change anything confidential), and we should be able to provide some pointers.
Back to top
View user's profile Send private message
zhaider
PostPosted: Mon Oct 10, 2016 11:10 am    Post subject: Reply with quote

Apprentice

Joined: 08 Oct 2015
Posts: 40

timber wrote:
I think you're confused about how IIB works. Please post your code (leave out or change anything confidential), and we should be able to provide some pointers.

What code exactly? The java compute code? It's is simple I'm converting it into an array of bytes by using toByteArray.
Back to top
View user's profile Send private message
timber
PostPosted: Mon Oct 10, 2016 1:31 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1280

Yes, I mean the Java code that you have used in your JavaCompute node.
Quote:
It's is simple I'm converting it into an array of bytes by using toByteArray.
I would like to to see exactly how you are doing that.
Back to top
View user's profile Send private message
zhaider
PostPosted: Thu Oct 13, 2016 2:42 am    Post subject: Reply with quote

Apprentice

Joined: 08 Oct 2015
Posts: 40

This is the application. I'm attaching it for your reference.

https://drive.google.com/file/d/0B4sMGVdXkAdNYS1DSFVEWXl5R0E/view?usp=sharing
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Oct 13, 2016 4:45 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20697
Location: LI,NY

well I did download your project and ended up with a lot of red stuff.
A few things to clarify what is going on:
  1. This is not a parser project and you are not writing a parser. You are just trying to use the existing parsers to solve your requirements.
  2. I did not see a DFDL model in your project. Maybe it is missing
  3. your java snippet / class is in the wrong place. It should be in a Java project of its own that is then referenced by your main project. The class name needs to start with a Capital letter. The transform from String to byte[] does not take into consideration any character set (this is wrong in oh so many levels)... Use something like String.getBytes("UTF-8") ...
  4. you need to model the XML message. Use new model, model from existing XML message...
  5. you need to provide a DFDL mapping for your XML simple text content.
  6. you need to extract the text from your XML and reparse it using the DFDL model.
  7. Alternatively if all you need to do is extract the simple text from the XML you could map to a BLOB and using your java function to prepend with the length of the text...(remember to change it to take into account the CCSID) ...

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
zhaider
PostPosted: Thu Oct 13, 2016 5:40 am    Post subject: Reply with quote

Apprentice

Joined: 08 Oct 2015
Posts: 40

a. Yes, you are kind of correct. The actual DFDL/message model is defined in another project which I forgot to attach but still that's not what the problem is.
b. Yeah, as I said I forgot to attach the DFDL, if you really require it I'll attach it tomorrow but it's not necessary for the problem. It should work from the second mapping node onwards.
c. It's just a test. We have made several applications with different flows trying to see how TCPIP works.
d. We does have it. Let me walkthrough you again, in the first mapping node my DFDL actually extracts the message from the input and appens it in a single string. Then as you can see in the second mapping node it sends it to the Java Compute and call the TCPIP.
e. I don't know how that works. Can you just rework the sample in a way where I'm sending a string and receiving a string. Just like you can do with simple Java code with Output/input stream?
Back to top
View user's profile Send private message
timber
PostPosted: Thu Oct 13, 2016 5:51 am    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1280

Quote:
Can you just rework the sample in a way where I'm sending a string and receiving a string. Just like you can do with simple Java code with Output/input stream?
I thought you said that you were receiving XML and sending some formatted text? I hope you would not try to treat an XML document as a string, even if you were using Java.

Please can you explain, in simple terms, what your message flow is doing. Show us the structure of your XML input and the structure of your text output. Explain how you derive the output from the input (in words, please).
Back to top
View user's profile Send private message
zhaider
PostPosted: Thu Oct 13, 2016 6:05 am    Post subject: Reply with quote

Apprentice

Joined: 08 Oct 2015
Posts: 40

Actually it is much more complicated that simple XML. What I receive a predefined set of strings that I parse into an XML to fetch the proper fields of message. After that lets say I get an XML that looks like this:

<Code>0778<Code>
<Password>gfdsghadfghas</Password>
<Text>safgfsahfsagh<Text>

Now, I take these three field values and appends it in a single string like that:

0778gfdsghadfghassafgfsahfsagh

Now, I need to send this message to the TCPIPNode, and receive output which will also be in a format but lacking a password:

0778safgfsahfsagh

Can you please tell me how I could do that?
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu Oct 13, 2016 6:12 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

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.
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » TCPIPClientOutput Node Usage
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.