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 » Validating XML messages with namespaces

Post new topic  Reply to topic
 Validating XML messages with namespaces « View previous topic :: View next topic » 
Author Message
chrisc
PostPosted: Sun Mar 19, 2006 8:29 pm    Post subject: Validating XML messages with namespaces Reply with quote

Voyager

Joined: 19 Mar 2006
Posts: 77

Hi there,

My company is in a situation at the moment where we have some existing message sets for XML messages that have no namespaces defined. All our flows have been written using namespace-unaware ESQL and work fine.

However, we need to move to versions that will be using namespaces. I have done some preliminary testing and found out that although putting the changes in place are easy enough, it is hard to verify that all fields have been done correctly, because XML gets treated by the broker as a "self-defining" message type, which means that it seems to assume that if you have something in your message tree that doesn't match the message set, it doesn't matter - just put it in the output anyway.

What I was wondering was, does anybody have any suggestions on ways to verify that all fields in the MRM tree actually belong in the output message set, and any extraneous ones get picked up? Content and value validation doesn't pick it up, the streaming by the output node doesn't pick it up, and the only indication seems to be when there is a type such as a xsd:DateTime that just gets picked up as Character by the next flow...

Alternatively, ideas about how to approach the migration as easily and painlessly as possible would also be greatly appreciated!

Cheers,
Chris
Back to top
View user's profile Send private message
kimbert
PostPosted: Mon Mar 20, 2006 2:07 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
does anybody have any suggestions on ways to verify that all fields in the MRM tree actually belong in the output message set, and any extraneous ones get picked up?
Yes - you need to use the MRM domain with an XML physical format, and switch on validation. You probably tried it already, and got tripped up by one of the gotchas.
A few key points:
- It's OK ( although a bit quirky ) not to use namespaces. Just create your message set with 'use namespaces' unset. You can still validate messages which don't use namespaces
- If the root tag in the input message is matched against one of your message definitions, everything within the message will get validated.
- One way to make sure the root tag is not matched against the message definition: leave the message set property 'Root Tag Name' set to its default value 'MRM'! If you have not cleared this field yet, do it now.

Let me know if this does not get you what you want - I know for a fact that the MRM domain can do what you need.
Back to top
View user's profile Send private message
chrisc
PostPosted: Mon Mar 20, 2006 2:38 pm    Post subject: Reply with quote

Voyager

Joined: 19 Mar 2006
Posts: 77

Thanks for the feedback Kimbert.

kimbert wrote:
Yes - you need to use the MRM domain with an XML physical format, and switch on validation. You probably tried it already, and got tripped up by one of the gotchas.

That wouldn't surprise me! There seem to be quite a few gotchas around with message sets and WBI generally to keep our eyes peeled for...

Anyway, we are using the MRM domain with an XML format, and we have tried with the validation turned on for the compute nodes, but it doesn't seem to be working. Our message trees - which don't specify namespaces when referencing fields - seem to still pass validation and get streamed out as XML, even though it quite obviously can't validate those fields against the namespace-using equivalents.

kimbert wrote:
- It's OK ( although a bit quirky ) not to use namespaces. Just create your message set with 'use namespaces' unset. You can still validate messages which don't use namespaces

Yeah, this was the way we approached it at the beginning. Unfortunately the message sets are under the governance of another department and they have decided we have to use their version, which has namespaces switched on.

kimbert wrote:
- If the root tag in the input message is matched against one of your message definitions, everything within the message will get validated.

That's what I thought, but unfortunately the root tag also needs to incorporate the namespace to be recognised as the message.

Update: I was just about to say that the message is getting written out without the validation process picking up the extraneous fields, but I just redeployed and now I'm getting the validation errors I expected!

kimbert wrote:
Let me know if this does not get you what you want - I know for a fact that the MRM domain can do what you need.

Indeed, it seems it does! I really don't know what exactly was going wrong. I was trying this yesterday pretty much all day, and it was refusing to validate the message, even with the validation turned on in the compute node. Today it's picking it up first go... I've had similar things before, where it doesn't seem to register a change to certain flow or node settings, despite multiple redeployments - does Message Broker have some sort of flakey caching mechanism I need to be careful of?

Thanks for your comments, Kimbert, that's certainly helped a lot. At least I know that if we need to make the transition, we should be able to identify if there were any fields missed...

Cheers,
Chris
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 » Validating XML messages with namespaces
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.