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 » xs:any, xs:choice and message broker

Post new topic  Reply to topic
 xs:any, xs:choice and message broker « View previous topic :: View next topic » 
Author Message
fazz
PostPosted: Mon Apr 10, 2006 1:59 am    Post subject: xs:any, xs:choice and message broker Reply with quote

Centurion

Joined: 20 Feb 2004
Posts: 144
Location: England

Hi,

I have an XML schema which has has a type with the following structure

Code:
<xs:sequence>
         <xs:choice>
            <xs:element name="TextMessage" type="cjseReceive:TextMessageType"/>
            <xs:element name="Base64Message" type="xmlmime:base64Binary"/>
            <xs:element name="HexBinaryMessage" type="xmlmime:hexBinary"/>
            <xs:any namespace="##other" processContents="skip" minOccurs="0"/>
         </xs:choice>
      </xs:sequence>

XMLSpy says this is OK, and parses the message correctly, but the message broker complains with the following error:

Code:
Invalid content starting with element 'xs:any'.  The parent content model is <choice>, which can only contain {annotation (0-1) , (element, group, sequence, choice) (0-UNBOUNDED)}.


Anyone else come across this, it seems it may be a difference in parsers?

Cheers
Back to top
View user's profile Send private message
kimbert
PostPosted: Mon Apr 10, 2006 3:02 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

This is a documented limitation in the message broker. It's only a warning - you will not be affected unless your message flow is validating the message. Note that this restriction has been lifted in v6.
Back to top
View user's profile Send private message
fazz
PostPosted: Mon Apr 10, 2006 3:05 am    Post subject: Reply with quote

Centurion

Joined: 20 Feb 2004
Posts: 144
Location: England

hmm....it shows up as an error and will not let me compile the message set.
My flow will also need to validate the message.
Is there a fix for v5 as I cannot upgrade to v6?
Back to top
View user's profile Send private message
kimbert
PostPosted: Mon Apr 10, 2006 3:43 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
hmm....it shows up as an error and will not let me compile the message set.
You're right. Sorry for misleading you
Quote:
Is there a fix for v5
No, but there is a workaround. Remove the wildcard (xs:any) from the choice and set the 'Content Validation' property to 'Open' or 'Open Defined'. ( use 'Open' unless you are certain that you have a global element defined for all possible elements which will appear in the choice).
Back to top
View user's profile Send private message
fazz
PostPosted: Mon Apr 10, 2006 4:14 am    Post subject: Reply with quote

Centurion

Joined: 20 Feb 2004
Posts: 144
Location: England

excellent that works a treat, thank you very much, was statring to bug me that one...

right next question, sorry, that now lets me create any element name in the choice, but if the new element is namepspaced, on parsing the namespace is replaced with NS1. I know I could add the namespace and prefix to the message set properties, but as its a wildcard element, I wont always know what it will be.

Is there a way of setting the message set so it just copies the correct namespace when parsing and does not replace it with NS1?

for example, I send this in

Code:
<sfReceive:Message>
               <m:DailyList xmlns:m="http://example.co.uk"></m:DailyList>
            </sfReceive:Message>


and get this out



Code:
<sfReceive:Message><NS1:DailyList xmlns:NS1="http://example.co.uk"></NS1:DailyList>
            </sfReceive:Message>
Back to top
View user's profile Send private message
kimbert
PostPosted: Mon Apr 10, 2006 4:46 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
Is there a way of setting the message set so it just copies the correct namespace when parsing and does not replace it with NS1?
First point, and a very important one. The namespace prefix is being changed, but the namespace is not. The output message is semantically equivalent to the input message.
If you were using the XMLNS domain, the prefixes would be preserved (but then you would not be able to validate against the schema).
Back to top
View user's profile Send private message
fazz
PostPosted: Mon Apr 10, 2006 5:05 am    Post subject: Reply with quote

Centurion

Joined: 20 Feb 2004
Posts: 144
Location: England

ok that makes sense.

is there a way of preserving the prefix, as the receiving applicaiton will be expecting a certain prefix not NS1.

thanks for all your help, nearly there
Back to top
View user's profile Send private message
kimbert
PostPosted: Mon Apr 10, 2006 5:47 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
is there a way of preserving the prefix
No - the only facility which the MRM offers for controlling prefixes is the 'Preferred prefixes' table in the message set. But you already know about that.
If you are not changing the message, you could save a copy of the input message in the environment, and simply copy it to the output as a BLOB ( but only if it passed validation, of course).
Back to top
View user's profile Send private message
fazz
PostPosted: Mon Apr 10, 2006 7:13 am    Post subject: Reply with quote

Centurion

Joined: 20 Feb 2004
Posts: 144
Location: England

can't do that as I need to work with the message.
so its seems the only option I have is to list all the possible namespace in the prefix table....might be possible, hope so....

thanks very much for your help
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 » xs:any, xs:choice and message broker
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.