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 » WMQI error while parsing XML

Post new topic  Reply to topic
 WMQI error while parsing XML « View previous topic :: View next topic » 
Author Message
Fuzzy_mq
PostPosted: Wed Sep 01, 2004 1:36 am    Post subject: WMQI error while parsing XML Reply with quote

Apprentice

Joined: 27 May 2004
Posts: 31
Location: US

Folks,

I am getting following error while converting my message from XML to CWF format.

'CWF Logical Tree - Message Definition Mismatch'

I have put the message set(import from XSD) in input node. The XSD has few elements which are optional i.e may be there or may not be.

I get this error when one of the optional elements is missing. It occurs on ResetContentDescriptor node.

How to get rid of this??

Thanks,
Suchit
Back to top
View user's profile Send private message
shanson
PostPosted: Wed Sep 01, 2004 3:56 am    Post subject: Reply with quote

Partisan

Joined: 17 Oct 2003
Posts: 344
Location: IBM Hursley

You need to supply default values for the elements in your outbound message. CWF is a fixed format - if an element is missing from the tree, and there is no default value, you get an exception.
Back to top
View user's profile Send private message
Fuzzy_mq
PostPosted: Wed Sep 01, 2004 5:04 am    Post subject: Reply with quote

Apprentice

Joined: 27 May 2004
Posts: 31
Location: US

Well, actually the optional elements has attributes, which contains the actual data. So if element is not there there won't be any attributes or defaults for the element.

My msg looks like this:
<MsgData>
<ApplData>
<Add value="2" comments=""TempA"/>
<Change value="56" comments=""TempC"/>
<Delete value="16" comments=""TempD"/>
</ApplData>
</MsgData>

In the above msg Add, Change and Delete elements are optional. If its there then attributes will have values. But if the element itself is not there then where can I set defaults for??

I hope you understand my problem!

Thanks,
Suchit
Back to top
View user's profile Send private message
shanson
PostPosted: Wed Sep 01, 2004 7:31 am    Post subject: Reply with quote

Partisan

Joined: 17 Oct 2003
Posts: 344
Location: IBM Hursley

I think you are misunderstanding default values. Defaults are set in the message set as a logical property of a (simple) element or attribute.

For a missing simple element or attribute, the CWF writer simply looks in the message dictionary and gets the default value.

For a missing complex element, the CWF writer looks in the dictionary for the children of the complex element and gets their default values.

Remember that a CWF bitstream is entirely comprised of simple values. So all you have to do is make sure that all the simple elements and attributes in your model have default values, and the CWF writer will do the rest.

One corollary of this is that if you have a totally empty body tree, the CWF writer can create a message consisting entirely of default values.

One last thing. The message 'CWF Logical Tree - Message Definition Mismatch' is not very helpful, but the full message that appears in the event log is a lot better. I'm guessing that you are catching exceptions and then looking at the exception list, because that will prevent the full message from being sent to the event log.
Back to top
View user's profile Send private message
Fuzzy_mq
PostPosted: Thu Sep 02, 2004 1:37 am    Post subject: Reply with quote

Apprentice

Joined: 27 May 2004
Posts: 31
Location: US

Shanson,

As I havn't done this before, I still havn't got this!!

as you have mentioned "Defaults are set in the message set as a logical property of a (simple) element or attribute. "

1) I do not see any option in Contorl center MessageSet window for setting this.
2) Are the defaults set in XSD. If yes then am using XMLSpy for creating XSD and there I do see default for each attribute for complex element. What do I mention here. I don't want to send even a space instead of this element if the element is not created.

Thanks for your patience, but you still need to enlighten me on this.

Regards,
Suchit
Back to top
View user's profile Send private message
shanson
PostPosted: Thu Sep 02, 2004 2:30 am    Post subject: Reply with quote

Partisan

Joined: 17 Oct 2003
Posts: 344
Location: IBM Hursley

Apologies, I was assuming V5. In V2.1 you create a default value by creating an Element Value object, then adding it to the Element with a Role of 'Default Value'.

However, it is a lot easier to get the schema importer to do this creation, by adding default values to your XML Schema.

Fuzzy_mq wrote:
I don't want to send even a space instead of this element if the element is not created.

Does this refer to the incoming XML or the outgoing CWF?
If CWF the concept of optionality does not apply. If an element is missing you have to have the default value.
If XML, it depends on what your sending application does if default values are present in the schema - there are schema rules for this, which are different for attributes and elements, but your application does not necessarily have to follow these.
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 » WMQI error while parsing XML
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.