Author |
Message
|
Rodeo |
Posted: Sat Oct 06, 2007 7:53 am Post subject: Message definitions and tns setting in message maps |
|
|
Apprentice
Joined: 11 Apr 2007 Posts: 30
|
I am importing an XML schema into my message set for a message definition. At the top of the schema there is a targetnamespace = "some name space" declaration. When I import this and use it as a target in my message map, the message map is automatically set the message type to tns:Tagname (and I can't edit this). When I import the schema without that targetnamespace setting in the schema, the target in message map doesn't have message type set to tns:tagname...it just says tagname (without the tns).
My issue is that after I execute the message map I am doing a reset content descriptor to the exact message domain/message set/message type, to perform complete validation. And in this node...I get the error that tns is not defined in the message definition which is correct. Is there a way I can remove that tns: in the message map ?
The other question: Is it a good practise to do a reset content though I executed a message map based on the message definition? The reason I am doing this reset is because the mapping node is not performing the validation, though I set parse timing to complete and validation to "content and value". RCD is helping me do this in the next step.
Any Suggestions/comments? |
|
Back to top |
|
 |
kimbert |
Posted: Sat Oct 06, 2007 10:55 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
I'm confused. I don't know whether you ended up using the original schema or the edited one. What is 'the exact message domain/set/type'? Please take time to explain
- what you are trying to achieve
- what you have tried
- what happened.
and please quote any error messages accurately.
You should not be adding an RCD node to compensate for a lack of validation in the Mapping node. You should find out why the Mapping node is not doing the validation. |
|
Back to top |
|
 |
Rodeo |
Posted: Sat Oct 06, 2007 1:00 pm Post subject: |
|
|
Apprentice
Joined: 11 Apr 2007 Posts: 30
|
Kimbert,
Thanks for the reply. I will try to check why my mapping node is not performing validation.
Here's my scenario:
I am using the MRM domain. For the message set to provide message definitions, I have imported XML schemas.
I was discussing 2 scenarios of XML schema below:
1) With the setting targetnamespace = "somenamepace" in one scenario.
When a message definition imported with above setting is used as a target message in the map:
the properties.messagetype is automatically set to tns:root_tag_of_message.
2) Without the setting targetnamespace in the 2nd scenario
With this type of message definition:
the properties.messagetype is set to root_tag_of_message.
When I use above settings and execute the message map and use a reset content descriptor to MRM domain after the message map,
I get the error that tns is not valid for tag name as follows:
ParserException
File = F:\\build\\S600_P\\src\\cpi\\pwf\\xml\\xmlhandler.cpp
Line = 1329
Function = XMLHandler::error
Type =
Name =
Label =
Catalog = BIPv600
Severity = 3
Number = 5117
Text = XMLHandler::error reported from the Xerces parser
Insert
Type = 2
Text = 277
Insert
Type = 5
Text = Null pointer
Insert
Type = 2
Text = 1
Insert
Type = 2
Text = 86
Insert
Type = 5
Text = The prefix 'tns2' has not been mapped to any URI
Insert
Type = 5
Text = ROOT_TAG
Insert
Type = 5
Text =
When I use scenario 2 above, no error message like the above shows up. |
|
Back to top |
|
 |
Rodeo |
Posted: Sat Oct 06, 2007 10:17 pm Post subject: |
|
|
Apprentice
Joined: 11 Apr 2007 Posts: 30
|
Attaching the following trace:
I would like to eliminate the tns2 that is being set for MessageType in the map ....Any suggestions?
Input body = (
(0x01000000):Properties = (
(0x03000000):MessageSet = 'PBLLQ28004001'
(0x03000000):MessageType = 'tns2:ROOTTAG'
(0x03000000):MessageFormat = NULL
(0x03000000):Encoding = 546
(0x03000000):CodedCharSetId = 437
(0x03000000):Transactional = TRUE
(0x03000000):Persistence = FALSE
(0x03000000):CreationTime = GMTTIMESTAMP '2007-10-07 06:09:21.200'
(0x03000000):ExpirationTime = -1
(0x03000000):Priority = 0
(0x03000000):ReplyIdentifier = X'000000000000000000000000000000000000000000000000'
(0x03000000):ReplyProtocol = 'MQ'
(0x03000000):Topic = NULL
(0x03000000):ContentType = ''
)
(0x01000000):MQMD = (
(0x03000000):SourceQueue = 'TESTQ'
(0x03000000):Transactional = TRUE
(0x03000000):Encoding = 546
(0x03000000):CodedCharSetId = 437
(0x03000000):Format = ' '
(0x03000000):Version = 2
(0x03000000):Report = 0
(0x03000000):MsgType = 8
(0x03000000):Expiry = -1
(0x03000000):Feedback = 0
(0x03000000):Priority = 0
(0x03000000):Persistence = 0
(0x03000000):MsgId = X'414d51205742524b365f44454641554c22e3074720002e07'
(0x03000000):CorrelId = X'000000000000000000000000000000000000000000000000'
(0x03000000):BackoutCount = 0
(0x03000000):ReplyToQ = ' '
(0x03000000):ReplyToQMgr = 'WBRK6_DEFAULT_QUEUE_MANAGER '
(0x03000000):UserIdentifier = ' '
(0x03000000):AccountingToken = X'16010515000000b7a871ffde140f41307f5e88f603000000000000000000000b'
(0x03000000):ApplIdentityData = ' '
(0x03000000):PutApplType = 11
(0x03000000):PutApplName = 'cts\RFHUTIL\ih03\rfhutil.exe'
(0x03000000):PutDate = DATE '2007-10-07'
(0x03000000):PutTime = GMTTIME '06:09:21.200'
(0x03000000):ApplOriginData = ' '
(0x03000000):GroupId = X'000000000000000000000000000000000000000000000000'
(0x03000000):MsgSeqNumber = 1
(0x03000000):Offset = 0
(0x03000000):MsgFlags = 0
(0x03000000):OriginalLength = -1
)
(0x01000021):MRM = (
(0x01000000):DATA = (
(0x01000000):item = (
(0x03000000):TAGA = '497'
(0x03000000):TAGB = '1'
(0x03000000):TAGC = 'TESTING'
(0x03000000):TAGD = '22Y'
(0x03000000):TAGE = '8281'
)
)
)
) |
|
Back to top |
|
 |
fjb_saper |
Posted: Sun Oct 07, 2007 8:15 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Rodeo wrote: |
1) With the setting targetnamespace = "somenamepace" in one scenario.
When a message definition imported with above setting is used as a target message in the map:
the properties.messagetype is automatically set to tns:root_tag_of_message. |
Question: You are using a namespace aware message set and the message type is set to tns:root_tag_of_message...
Why does that bother you? Is the output any different from what the definition requires?
If it works and you are doing the rest for cosmetic reasons, forget it. XML is not meant to be read by people but to be processed by machines first...
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
Rodeo |
Posted: Sun Oct 07, 2007 9:53 am Post subject: |
|
|
Apprentice
Joined: 11 Apr 2007 Posts: 30
|
fjb_saper wrote: |
Question: You are using a namespace aware message set and the message type is set to tns:root_tag_of_message...
Why does that bother you? Is the output any different from what the definition requires?
If it works and you are doing the rest for cosmetic reasons, forget it. XML is not meant to be read by people but to be processed by machines first...
Enjoy  |
Yes, I am using a namespace aware message set and the type is being set to tns:root_tag_of_message.
However, after the execution of mapping node (converts the message from XML to XML with tns:root_tag_name and a bunch of other mappings) I am using an RCD node. the reason for RCD is that the mapping node is not validating the output message it generates though I set the the parse timing to either complete or Immediate and set validation to content and value. So RCD is helping me do that in the next step. The issue is: When RCD node executes, it is unable to verify that tns1 (or other prefixe that I use in the imported schema) is part of the name space aware message and throwing the error:
ParserException
File = F:\\build\\S600_P\\src\\cpi\\pwf\\xml\\xmlhandler.cpp
Line = 1329
Function = XMLHandler::error
Type =
Name =
Label =
Catalog = BIPv600
Severity = 3
Number = 5117
Text = XMLHandler::error reported from the Xerces parser
Insert
Type = 2
Text = 277
Insert
Type = 5
Text = Null pointer
Insert
Type = 2
Text = 1
Insert
Type = 2
Text = 41
Insert
Type = 5
Text = The prefix 'nsp1' has not been mapped to any URI
Insert
Type = 5
Text = ROOT_TAG
Insert
Type = 5
Text =
The "namespace settings / Namespace declarations" in my XML1 wireformat in the message set already have the prefix nsp1 and the Namespace URI included in them.
This is my flow structure:
Input -> Mapping -> RCD (for validation only) -> Output |
|
Back to top |
|
 |
fjb_saper |
Posted: Sun Oct 07, 2007 6:27 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Seems to me like you're going at it the wrong way.
If you need to validate don't use the XMLNS domain use the MRM domain right away, and do the mapping there...
You should then have the validation right away...
What I'm thinking here is that you might also need to declare the namespace in your flow... not just in the map. Have it be a schema wide validity...
Are you sure all the namespaces used are declared in the message set?
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|