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 » XML, MRM and BOOLEAN values

Post new topic  Reply to topic
 XML, MRM and BOOLEAN values « View previous topic :: View next topic » 
Author Message
fazz
PostPosted: Mon Jul 31, 2006 7:04 am    Post subject: XML, MRM and BOOLEAN values Reply with quote

Centurion

Joined: 20 Feb 2004
Posts: 144
Location: England

Hi all,

Hope you can help before I loose my hair.....

I have a message coming in on the XMLNS domain, I have a message set created from a XML schema which contains one field which if of type boolean.

The flow maps the input XML to the MRM domain and outputs ok.
Thing is, the value of the input field which maps to the boolean type is 'true', when this is output it is 'TRUE'. The message then heads of to Proccess server which compains 'TRUE' is not valid for a boolean data type.

I can see there are two settings on the XML layer of the message set "XML representation of boolean values", these were set to 1 and 0, I changed them to be 'true' and 'false' but to no avail...

Is there any way of stopping this uppercasing?

Regards
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Jul 31, 2006 7:23 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Everything that comes in as XMLNS/XMLNSC is always string data, not integer data or binary data or boolean data.

So what you're getting is the string value "true" , not a boolean. Try CAST.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
fazz
PostPosted: Mon Jul 31, 2006 7:28 am    Post subject: Reply with quote

Centurion

Joined: 20 Feb 2004
Posts: 144
Location: England

Yes I understand that, but when I parse the message against the MRM domain I guess it is turning the value from true to TRUE when it finds the boolean field definition?

I am using the CREATE LASTCHILD .....DOMAIN MRM PARSE(ASBITSTREAM(InputRoot.XMLNS etc.......

Thanks.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Jul 31, 2006 7:35 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

fazz wrote:
I am using the CREATE LASTCHILD .....DOMAIN MRM PARSE(ASBITSTREAM(InputRoot.XMLNS etc.......


Umm.

You will save a heck of a lot of computation time if you just use "SET". What you're doing there is serializing at least some portion of the tree, and then unserializing.

It makes very little sense to do it the way you're doing. If you have an InputRoot.XMLNS.A.B.C field and you want to put it to an OutputRoot.MRM.A.B.C then just "Set OutputRoot.MRM.A.B.C=InputRoot.XMLNS.A.B.C". For the case of a Boolean field, you may need to "Set OutputRoot.MRM.A.B.C = CAST(Input.Root.XMLNS.A.B.C as Boolean);".
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
fazz
PostPosted: Mon Jul 31, 2006 11:23 pm    Post subject: Reply with quote

Centurion

Joined: 20 Feb 2004
Posts: 144
Location: England

But will just setting the OutputRoot.field = InputRoot.field parse the tree against the message set? I want to check the structure to make sure it is correct.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Aug 01, 2006 1:36 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

That's still not the way to do it.
http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/index.jsp?topic=/com.ibm.etools.mft.doc/ac00400_.htm
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
fazz
PostPosted: Tue Aug 01, 2006 1:52 am    Post subject: Reply with quote

Centurion

Joined: 20 Feb 2004
Posts: 144
Location: England

Validation on the output is only for v6 not v5 (which I am using).
So to fully validate the output message I need to use the PARSE clause of the CREATE function.

Doing this converts the XML string value 'true' to 'TRUE'
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Aug 01, 2006 2:00 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

fazz wrote:
Validation on the output is only for v6 not v5 (which I am using).
So to fully validate the output message I need to use the PARSE clause of the CREATE function.


No, I don't think so.
Same link, v5 Info Center.
http://publib.boulder.ibm.com/infocenter/wbihelp/v6rxmx/index.jsp?topic=/com.ibm.etools.mft.fp8.doc/ac00400_.htm
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
fazz
PostPosted: Tue Aug 01, 2006 2:21 am    Post subject: Reply with quote

Centurion

Joined: 20 Feb 2004
Posts: 144
Location: England

Yes Ok, a little bit misleading as you have to set the valdiation settings on the compute node for v5 not the output node like you can in v6.

But basically whatever way you do it, it still suffers from the same problem.
Back to top
View user's profile Send private message
kimbert
PostPosted: Mon Aug 07, 2006 2:24 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

fazz,

You don't need to re-parse the bitstream in order to validate the message. You can create an MRM output tree, copy the input tree to it ( using SET ), and then request validation of the output message tree via the validation settings on the Compute node. I presume you've sorted that out now.

The boolean true/false problem is very puzzling. I've never heard of anyone having trouble with this before. Check the following:
- If you change the settings to 'yes' and 'no' instead of 'true' and 'false', do you get 'YES' and 'NO' in the output message?
- If changing the boolean true/false settings does not change the output message, then your output message tree does not match the message definition ( some or all of the message is self-defining ).
- Is it possible that your message flow is doing the uppercasing?
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Aug 07, 2006 2:54 am    Post subject: Reply with quote

Grand High Poobah

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

kimbert wrote:
fazz,

The boolean true/false problem is very puzzling. I've never heard of anyone having trouble with this before.
- If changing the boolean true/false settings does not change the output message, then your output message tree does not match the message definition ( some or all of the message is self-defining ).
- Is it possible that your message flow is doing the uppercasing?


What is happening there is that there is no message SET used for the XMLNS input or output part.
You need to use the message set for the input/output. Otherwise the broker does not know the TYPE of the variable and your boolean true is treated as string 'true' on input or boolean TRUE is treated as string 'TRUE' on output.
As mentionned above you might try the CAST (treename AS boolean). But I find it challenging if there is an easier way (message set available through imported xsds).

On output for the XMLNS part you may as well try and set the values of boolean on the XML1 properties of the message set.

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
kimbert
PostPosted: Mon Aug 07, 2006 3:24 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
What is happening there is that there is no message SET used for the XMLNS input or output part.
How can you be so sure? fazz is changing to the MRM domain as part of his message flow. I was assuming that he was writing the message using the MRM as well. If not, then he should.
Quote:
As mentioned above you might try the CAST (treename AS boolean)
That would be harmless, but unnecessary. The MRM matches on namespace/name only. It makes no difference whether or not the syntax element in the tree is a boolean, as long as the MRM parser can CAST it to a boolean.
Quote:
On output for the XMLNS part you may as well try and set the values of boolean on the XML1 properties of the message set.
XMLNS? That's a typo, surely? XMLNS does not use message sets, so setting these properties will have zero effect on the output.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Aug 07, 2006 2:30 pm    Post subject: Reply with quote

Grand High Poobah

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

We have had very similar problems. They mostly derive from the fact that the input message is MRM (cobol) and the output message XMLNS without the use of a message set. We have seen the TRUE value being passed to the XMLNS as string and not boolean (mapping in ESQL). Serialization is not guaranteed to give you what you want (all booleans as 0 and 1 or true and false but no mix) and without message set there is no verification...so if you end up with a char type instead of boolean you might spend just too much time trying to find out where you went wrong.

The use of a message set standardizes the serialization output especially where boolean values are concerned. As we have the xsds being created for the apps anyway so we just use the MRM domain and message set to obtain a clean serialization (output flow 1) before reading back into (input flow2/aggregation) the next flow in XMLNS.

Hope it clarifies some...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
kimbert
PostPosted: Tue Aug 08, 2006 12:06 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

fjp_saper :
Thanks for that clarification. This is a defect in the product. The XMLNS and XMLNSC domains always output a BOOLEAN value as 'TRUE' or 'FALSE' ( uppercase), and there is no way to override this. So if you're parsing with the MRM parser and writing with XML, XMLNS or XMLNSC parsers, any boolean values in the message will be written in a way which is not compliant with XML Schema. (see http://www.w3.org/TR/xmlschema-2/#boolean)

fazz :
Please raise a PMR, and include a link to this post in the problem description. If you could let me know the number, it might help things along.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » XML, MRM and BOOLEAN values
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.