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 » WMB: How to handle mixed data types(within a field) in WMBv7

Post new topic  Reply to topic Goto page 1, 2  Next
 WMB: How to handle mixed data types(within a field) in WMBv7 « View previous topic :: View next topic » 
Author Message
mkh
PostPosted: Tue Sep 10, 2013 4:35 am    Post subject: WMB: How to handle mixed data types(within a field) in WMBv7 Reply with quote

Newbie

Joined: 10 Sep 2013
Posts: 5

Hello,

Input MRM message has fields each of which comprises of mixed datatypes, for example:
CRDRSP = char(4)+char(15)+binary(20)+char(4)+binary(16)

and that should be represented in the output XML
<CRDRSP>char(4)+char(15)+binary(20)->hex(40)+char(4)+binary(16)->hex(32) </CRDRSP>

How to define in model(MRM-CWF)?

Thank you for your support.

Best regards,
Kazim
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Sep 10, 2013 4:42 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

XML is not designed to hold random strings of bytes in the content of an element as raw bytes.

So, the answer is, you don't. The end result is going to be an unparseable XML document.

Otherwise, the technique is "create a message definition file that contains elements for each field, with the correct properties to allow that definition to parse the document".
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Sep 10, 2013 4:43 am    Post subject: Re: WMB: How to handle mixed data types(within a field) in W Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

mkh wrote:
How to define in model(MRM-CWF)?


As their data types with whatever delimits them (possibly their length).

As to how to represent that in XML, the standard doesn't allow that kind of mixed format so I assume there's some kind of internal standard you need to build
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
exerk
PostPosted: Tue Sep 10, 2013 4:51 am    Post subject: Reply with quote

Jedi Council

Joined: 02 Nov 2006
Posts: 6339

Moved to the Message Broker forum...
_________________
It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Tue Sep 10, 2013 4:57 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

The only way to handle this within XML is to hex-encode the field and wrap that result in CDATA.

As mqjeff says, you cannot place non-textual characters inside an XML tag. For example, how would you escape a hex value that corresponds to a reserved XML value?
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
mkh
PostPosted: Tue Sep 10, 2013 5:15 am    Post subject: Reply with quote

Newbie

Joined: 10 Sep 2013
Posts: 5

- I have defined the filed as element of 'xsd:string' and in the compute node: SET OutputRoot.XML."Message" = InputRoot.MRM;
then in the generated output XML message, I see the characters parsed to String(same as sent), but the binary data parsed to special characters(unreadble)

- when defined as 'xsd:hexBinary' the binary data parsed to meaningful output value but the characters are parsed to the values which I do not understand

- when defined CRDRSP as complexType within which 5 local elements of corresponding data types, but following error:
"The bit stream of the message being parsed by the MRM parser is larger than expected for a message of this type"
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Tue Sep 10, 2013 5:16 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

mkh wrote:
- I have defined the filed as element of 'xsd:string' and in the compute node: SET OutputRoot.XML."Message" = InputRoot.MRM;
then in the generated output XML message, I see the characters parsed to String(same as sent), but the binary data parsed to special characters(unreadble)

- when defined as 'xsd:hexBinary' the binary data parsed to meaningful output value but the characters are parsed to the values which I do not understand

- when defined CRDRSP as complexType within which 5 local elements of corresponding data types, but following error:
"The bit stream of the message being parsed by the MRM parser is larger than expected for a message of this type"


DIDN'T WE JUST SAY WHAT YOU ARE DOING WILL NOT WORK?
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
Vitor
PostPosted: Tue Sep 10, 2013 5:23 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

mkh wrote:
- I have defined the filed as element of 'xsd:string' and in the compute node: SET OutputRoot.XML."Message" = InputRoot.MRM;
then in the generated output XML message, I see the characters parsed to String(same as sent), but the binary data parsed to special characters(unreadble)

- when defined as 'xsd:hexBinary' the binary data parsed to meaningful output value but the characters are parsed to the values which I do not understand


Yes, 3 people have told you XML can't handle that.

mkh wrote:
- when defined CRDRSP as complexType within which 5 local elements of corresponding data types, but following error:
"The bit stream of the message being parsed by the MRM parser is larger than expected for a message of this type"


This implies there's a problem with your message set on the inbound, and even if there wasn't you'd get a CRDRSP tag with 5 children not a single tag with a single value.

You also shouldn't be using the XML domain in the sense of:
Code:
SET OutputRoot.XML."Message"


Use XMLNSC. Though this will not help with your impossible problem.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Sep 10, 2013 5:25 am    Post subject: Re: WMB: How to handle mixed data types(within a field) in W Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

mkh wrote:
and that should be represented in the output XML
<CRDRSP>char(4)+char(15)+binary(20)->hex(40)+char(4)+binary(16)->hex(32) </CRDRSP>


Back to first principles - why are you attempting to do this? What's the requirement (and the correct answer is not any variant of "I was told to do this")? What's consuming this XML once you manage to produce it?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mkh
PostPosted: Tue Sep 10, 2013 5:32 am    Post subject: Reply with quote

Newbie

Joined: 10 Sep 2013
Posts: 5

another application server (weblogic) reads that XML message

requirement is - WMB should parse the character data as is and binary to be in hex.

- 5 children would not be a problem, target application will read.
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Sep 10, 2013 5:40 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

mkh wrote:
- 5 children would not be a problem, target application will read.


Then I recommend you do that, and wonder why you didn't in the first place.

I also wonder what in weblogic would have been able to parse the XML without abending if you'd managed to build it as you first intended.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mkh
PostPosted: Tue Sep 10, 2013 5:44 am    Post subject: Reply with quote

Newbie

Joined: 10 Sep 2013
Posts: 5

from definition file:
<xsd:element name="CRDRSP">
<xsd:complexType>
<xsd:sequence maxOccurs="1" minOccurs="1">
<xsd:element name="Field1" type="xsd:string">
</xsd:element>
<xsd:element name="Field2" type="xsd:string">
</xsd:element>
<xsd:element name="Field3" type="xsd:hexBinary">
</xsd:element>
<xsd:element name="Field4" type="xsd:string">
</xsd:element>
<xsd:element name="Field5" type="xsd:hexBinary">
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>

Is there anything missing or wrong?
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Sep 10, 2013 6:05 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

mkh wrote:
Is there anything missing or wrong?


The code tags round your post?

What happens why you try it? Why ask us if it's right when you can test it out & make the determination yourself in a fraction of the time?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mkh
PostPosted: Tue Sep 10, 2013 6:41 am    Post subject: Reply with quote

Newbie

Joined: 10 Sep 2013
Posts: 5

runtime exception:
"The bit stream of the message being parsed by the MRM parser is larger than expected for a message of this type"
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Tue Sep 10, 2013 6:42 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

mkh wrote:
runtime exception:
"The bit stream of the message being parsed by the MRM parser is larger than expected for a message of this type"


Wow, that is interesting. What's your plan to fix it ?
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
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 » WMB: How to handle mixed data types(within a field) in WMBv7
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.