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 message validation

Post new topic  Reply to topic
 XML message validation « View previous topic :: View next topic » 
Author Message
dsriksha
PostPosted: Wed Feb 15, 2006 10:38 am    Post subject: XML message validation Reply with quote

Voyager

Joined: 27 Feb 2005
Posts: 95

In my flow am dynamically generating XML messages(with namespaces) in XMLNS domain. This XML message matches in structure with the XML message generated from XML schema (Which I got from client side).

I found out from the XML schema(Which I got from client) that some of the elements are of diffrent data type say int, boolean, timestamp. Where as my message (in XMLNS) contains char type elements.

I have gone through this link and manuals
http://www.mqseries.net/phpBB2/viewtopic.php?t=18988&highlight=schema

My question is do I need validation (from the above situation) against the XML Schema imported messageset (of course in MRM domain)?

I really appreciate the answer with little explanation or just Y or N.
I believe that the answer is N.


Last edited by dsriksha on Wed Feb 15, 2006 2:24 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
vennela
PostPosted: Wed Feb 15, 2006 12:12 pm    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

Quote:
This XML message matches in structure with the XML message generated from XML schema (Which I got from client side).


Quote:
I found out from the XML schema(Which I got from client) that some of the elements are of diffrent data type say int, boolean, timestamp. Where as my message (in XMLNS) contains char type elements.

I think the above two statements are contradicting, unless I am missing something else.
You need to tell us more I think.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
dsriksha
PostPosted: Wed Feb 15, 2006 1:21 pm    Post subject: Reply with quote

Voyager

Joined: 27 Feb 2005
Posts: 95

Hi Vennela
Quote:
This XML message matches in structure with the XML message generated from XML schema (Which I got from client side).


I mean just the order of elements but not data types
Back to top
View user's profile Send private message Send e-mail
dsriksha
PostPosted: Wed Feb 15, 2006 2:02 pm    Post subject: Reply with quote

Voyager

Joined: 27 Feb 2005
Posts: 95

More details.

Am creating XML message from TDS message format, which will be sent to APPLICATION "A". This XML message is dynamically generated in compute node using ESQL with XMLNS domain. Note that all the element values are char type.
From the APPLICATION "A" I got the XML SCHEMA and confirmed that order of elements is correct, but not the datatypes.
Now, my quetion is about validation. Can I send the XMLmessage without validation? or do Ineed to validate the message.
Back to top
View user's profile Send private message Send e-mail
dilse
PostPosted: Wed Feb 15, 2006 3:24 pm    Post subject: Reply with quote

Master

Joined: 24 Jun 2004
Posts: 270

dsriksha,
I think if you are getting in the correct order and able to generate XML successfully then it should do in general but if you want to validate the data types as well then you should create a message set corresponding to the XML Schema and assign the elements as you did it in former case. If a message goes thru you are now 100% sure that the data type is also matching and generating in the correct order. Let us know if you still have any questions.


DilSe..
Back to top
View user's profile Send private message
dsriksha
PostPosted: Wed Feb 15, 2006 5:22 pm    Post subject: Reply with quote

Voyager

Joined: 27 Feb 2005
Posts: 95

Thanks Dilse.
For clarification..
When I send the XML messages datatypes also carried to the application?
(From Wbimb to some target side using WMQ)
For Example:

This is what my generated XML message with all elements are of CHAR type

<?xml version="1.0" encoding="ISO-8859-1" ?>
<MessageHeader>
<Time>2005-02-28-16.23.22</Time>
<MQID>ARROP</MQID>
<Fun>Y</Fun>
</MessagrHeader>

However client (Target side) may expect the Element "Fun" is of Boolean type (Because their XML schema defined in that way). Still the value is just 'Y'.

In this situation do I need to cast for Boolean type or just sending Char type is ok.
Back to top
View user's profile Send private message Send e-mail
vennela
PostPosted: Wed Feb 15, 2006 6:52 pm    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

Maybe you should use XSLT and XMLTransformation node.
I might be wrong though.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kimbert
PostPosted: Thu Feb 16, 2006 2:18 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

'Y' is not a valid Boolean value in XML Schema. You need to use 'true' and 'false', otherwise the Client application will reject the message.
Validation will not correct this problem, although it would highlight the problem.
You need to translate Y/N to true/false in your ESQL code when you build the output message.
Back to top
View user's profile Send private message
dsriksha
PostPosted: Thu Feb 16, 2006 5:43 am    Post subject: Reply with quote

Voyager

Joined: 27 Feb 2005
Posts: 95

Quote:
You need to translate Y/N to true/false in your ESQL code when you build the output message


Thanks kimbert.

To confirm

By sending true or false as a string instead of boolean is also ok?
Back to top
View user's profile Send private message Send e-mail
kimbert
PostPosted: Thu Feb 16, 2006 5:54 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
By sending true or false as a string instead of boolean is also ok?
I'm not sure what you mean. How could you 'send true or false' as anything other than a string?. The output message is XML - just a stream of characters.
Back to top
View user's profile Send private message
dsriksha
PostPosted: Thu Feb 16, 2006 6:24 am    Post subject: Reply with quote

Voyager

Joined: 27 Feb 2005
Posts: 95

Quote:
The output message is XML - just a stream of characters.


I apologize if I sound too novice. So whatever datatype we assign in esql code, since the output message is XML that becomes a character. Then why we need to do validation against datatypes for output xml messages?
Back to top
View user's profile Send private message Send e-mail
kimbert
PostPosted: Thu Feb 16, 2006 6:39 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
Then why we need to do validation against datatypes for output xml messages?
Because you may want to ensure that the output message conforms to the schema. In your case, you might want to trap errors like <Fun>Y</Fun> or <date>true</date> or <integer>xyz</integer> before the client application finds them and complains.
Back to top
View user's profile Send private message
dsriksha
PostPosted: Thu Feb 16, 2006 6:50 am    Post subject: Reply with quote

Voyager

Joined: 27 Feb 2005
Posts: 95

thanks for Kimbert and all.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » XML message validation
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.