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 » Msg validation for a service with 2 interfaces - HTTP &

Post new topic  Reply to topic Goto page 1, 2  Next
 Msg validation for a service with 2 interfaces - HTTP & « View previous topic :: View next topic » 
Author Message
prasadpav
PostPosted: Tue Nov 23, 2010 3:12 am    Post subject: Msg validation for a service with 2 interfaces - HTTP & Reply with quote

Centurion

Joined: 03 Oct 2004
Posts: 142

Hi,
We have a message broker service which accepts messages over 2 protocols - SOAP Over HTTP messages on SOAPInput node and MQInput node. In both the cases, the message is a SOAP envelope (soap 1.1). I've message validation turned ON on both the input nodes. SOAPInput node validation is fine. On MQInput node, the validation options are set to - XMLNSC, Messageset name, format and type are blank, parsing options immediate, validate content and value, throw exception in case of errors".

MQInput validation is happening *ONLY* for the elements within a defined message, but if I pass undefined message, then no exception is being raised.

I need to explain few more things which some of you might expect :

Quote:
- When WSDL is imported to create the message set, the SOAP:Body is modelled as "Open Defined" (which means that the message in SOAP body can be any message as long as it is defined within the same message set)
- The message set has "SOAP" & "XMLNSC" domains selected
- When I deploy I can see <messageset>.xsdzip
- MB version 6.1.0.5

MQInput node is supposed to throw an exception if the message within the SOAP body is not defined within the message set, instead, it is propagating to the out terminal and message is fully parsed. I can even write the message to a queue using MQOutput node.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Nov 23, 2010 3:17 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

You need to tell it what message set to validate against....

You should also look at the Parser Options tab in the properties of the MQInput node.
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Nov 23, 2010 3:48 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
MQInput validation is happening *ONLY* for the elements within a defined message, but if I pass undefined message, then no exception is being raised.
Are you 100% sure that the XMLNSC parser is being used? Can you post some Trace node output or user trace output to prove it? I have to ask, because XMLNSC will not accept an invalid root tag when validation is enabled. MRM will, and will treat it as a self-defining message.
Back to top
View user's profile Send private message
prasadpav
PostPosted: Tue Nov 23, 2010 3:58 am    Post subject: Reply with quote

Centurion

Joined: 03 Oct 2004
Posts: 142

Quote:
XMLNSC will not accept an invalid root tag when validation is enabled

The root tag is valid in this case, which is soap envelope message and it is defined in the message set. But the message within "soap:Body" is "Open defined", the validation of this content which is not happening.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Nov 23, 2010 4:09 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Ah!

There is a specific, tricky property that applies here...
You need to adjust the Process Content property of the wildcard element in the message tree.
http://publib.boulder.ibm.com/infocenter/wmbhelp/v7r0m0/index.jsp?topic=/com.ibm.etools.mft.doc/ad11890_.htm
Back to top
View user's profile Send private message
prasadpav
PostPosted: Tue Nov 23, 2010 6:40 am    Post subject: Reply with quote

Centurion

Joined: 03 Oct 2004
Posts: 142

wildcard element do not apply in this case because soap:Body is modelled as a choice which can take "message" composition or a soap:Fault.
Quote:
<xs:element name="Body" type="soapenv:Body" />
<xs:complexType name="Body">
<xs:sequence maxOccurs="unbounded">
<xs:choice>
<xs:annotation> <xs:appinfo source="WMQI_APPINFO"> <MRLocalGroup composition="message"
content="openDefined" />
</xs:appinfo>
</xs:annotation>
<xs:element ref="soapenv:Fault"/>
</xs:choice>
</xs:sequence>
<xs:anyAttribute namespace="##any" processContents="lax" />
</xs:complexType>

The trace output is:
Quote:
( ['MQROOT' : 0x1111e3cb0]
(0x01000000:Name ):Properties = ( ['MQPROPERTYPARSER' : 0x111da31b0]
(0x03000000:NameValue):MessageSet = 'MSGSET_Visa_Account_Information' (CHARACTER)
(0x03000000:NameValue):MessageType = '' (CHARACTER)
(0x03000000:NameValue):MessageFormat = '' (CHARACTER)
(0x03000000:NameValue):Encoding = 273 (INTEGER)
(0x03000000:NameValue):CodedCharSetId = 819 (INTEGER)
(0x03000000:NameValue):Transactional = TRUE (BOOLEAN)
(0x03000000:NameValue):Persistence = TRUE (BOOLEAN)
(0x03000000:NameValue):CreationTime = GMTTIMESTAMP '2010-11-23 13:56:00.080' (GMTTIMESTAMP)
(0x03000000:NameValue):ExpirationTime = -1 (INTEGER)
(0x03000000:NameValue):Priority = 0 (INTEGER)
(0x03000000:NameValue):ReplyIdentifier = X'000000000000000000000000000000000000000000000000' (BLOB)
(0x03000000:NameValue):ReplyProtocol = 'MQ' (CHARACTER)
(0x03000000:NameValue):Topic = NULL
(0x03000000:NameValue):ContentType = '' (CHARACTER)
(0x03000000:NameValue):IdentitySourceType = '' (CHARACTER)
(0x03000000:NameValue):IdentitySourceToken = '' (CHARACTER)
(0x03000000:NameValue):IdentitySourcePassword = '' (CHARACTER)
(0x03000000:NameValue):IdentitySourceIssuedBy = '' (CHARACTER)
(0x03000000:NameValue):IdentityMappedType = '' (CHARACTER)
(0x03000000:NameValue):IdentityMappedToken = '' (CHARACTER)
(0x03000000:NameValue):IdentityMappedPassword = '' (CHARACTER)
(0x03000000:NameValue):IdentityMappedIssuedBy = '' (CHARACTER)
)
(0x01000000:Name ):MQMD = ( ['MQHMD' : 0x111660110]
(0x03000000:NameValue):SourceQueue = 'TEST.IN' (CHARACTER)
(0x03000000:NameValue):Transactional = TRUE (BOOLEAN)
(0x03000000:NameValue):Encoding = 273 (INTEGER)
(0x03000000:NameValue):CodedCharSetId = 819 (INTEGER)
(0x03000000:NameValue):Format = ' ' (CHARACTER)
(0x03000000:NameValue):Version = 2 (INTEGER)
(0x03000000:NameValue):Report = 0 (INTEGER)
(0x03000000:NameValue):MsgType = 8 (INTEGER)
(0x03000000:NameValue):Expiry = -1 (INTEGER)
(0x03000000:NameValue):Feedback = 0 (INTEGER)
(0x03000000:NameValue):Priority = 0 (INTEGER)
(0x03000000:NameValue):Persistence = 1 (INTEGER)
(0x03000000:NameValue):MsgId = X'414d512044564d4230312020202020204cd162722046b002' (BLOB)
(0x03000000:NameValue):CorrelId = X'000000000000000000000000000000000000000000000000' (BLOB)
(0x03000000:NameValue):BackoutCount = 0 (INTEGER)
(0x03000000:NameValue):ReplyToQ = ' ' (CHARACTER)
(0x03000000:NameValue):ReplyToQMgr = 'DVMB01 ' (CHARACTER)
(0x03000000:NameValue):UserIdentifier = ' ' (CHARACTER)
(0x03000000:NameValue):AccountingToken = X'0000000000000000000000000000000000000000000000000000000000000000' (BLOB)
(0x03000000:NameValue):ApplIdentityData = ' ' (CHARACTER)
(0x03000000:NameValue):PutApplType = 0 (INTEGER)
(0x03000000:NameValue):PutApplName = ' ' (CHARACTER)
(0x03000000:NameValue):PutDate = DATE '2010-11-23' (DATE)
(0x03000000:NameValue):PutTime = GMTTIME '13:56:00.080' (GMTTIME)
(0x03000000:NameValue):ApplOriginData = ' ' (CHARACTER)
(0x03000000:NameValue):GroupId = X'000000000000000000000000000000000000000000000000' (BLOB)
(0x03000000:NameValue):MsgSeqNumber = 1 (INTEGER)
(0x03000000:NameValue):Offset = 0 (INTEGER)
(0x03000000:NameValue):MsgFlags = 0 (INTEGER)
(0x03000000:NameValue):OriginalLength = -1 (INTEGER)
(0x01000000:Folder):XMLNSC = ( ['xmlnsc' : 0x111668fb0]
(0x01000000:Folder)http://schemas.xmlsoap.org/soap/envelope/:Envelope = (
(0x03000102:NamespaceDecl)http://www.w3.org/2000/xmlns/:SOAP-ENV = 'http://schemas.xmlsoap.org/soap/envelope/' (CHARACTER)
(0x03000102:NamespaceDecl)http://www.w3.org/2000/xmlns/:SOAP-ENC = 'http://schemas.xmlsoap.org/soap/encoding/' (CHARACTER)
(0x03000102:NamespaceDecl)http://www.w3.org/2000/xmlns/:xsi = 'http://www.w3.org/2001/XMLSchema-instance' (CHARACTER)
(0x03000102:NamespaceDecl)http://www.w3.org/2000/xmlns/:xsd = 'http://www.w3.org/2001/XMLSchema' (CHARACTER)
(0x01000000:Folder )http://schemas.xmlsoap.org/soap/envelope/:Body = (
(0x01000000:Folder)urn:mynamespace:VisaAccountInformationRequestxx = (
(0x03000102:NamespaceDecl)http://www.w3.org/2000/xmlns/:m = 'urn:mynamespace' (CHARACTER)
(0x03000000:PCDataField )urn:mynamespace:accountId = '7777888833331124' (CHARACTER)
)
)
)


And the usertrace is:
Quote:
Timestamps are formatted in local time, local time is GMT.
Trace written by version ; formatter version 6105

2010-11-23 13:53:59.999040 10447 UserTrace BIP6060I: Parser type ''Properties'' created on behalf of node 'TestXMLNSCValidationFailureScenario.TEST.IN
' to handle portion of incoming message of length 0 bytes beginning at offset '0'.
2010-11-23 13:53:59.999180 10447 UserTrace BIP6061I: Parser type ''MQMD'' created on behalf of node 'TestXMLNSCValidationFailureScenario.TEST.IN' to h
andle portion of incoming message of length '364' bytes beginning at offset '0'. Parser type selected based on value ''MQHMD'' from previous parser.
2010-11-23 13:54:00.017957 10447 UserTrace BIP6061I: Parser type ''XMLNSC'' created on behalf of node 'TestXMLNSCValidationFailureScenario.TEST.IN' to
handle portion of incoming message of length '542' bytes beginning at offset '364'. Parser type selected based on value ''XMLNSC'' from previous parser.
2010-11-23 13:54:00.017996 10447 UserTrace BIP2632I: Message received and propagated to 'out' terminal of MQ input node 'TestXMLNSCValidationFailureSc
enario.TEST.IN'.
2010-11-23 13:54:00.018180 10447 UserTrace BIP2539I: Node 'TestXMLNSCValidationFailureScenario.Trace': Evaluating expression ''Root'' at ('', '1.3').
This resolved to ''Root''. The result was ''ROW... Root Element Type=16777216 NameSpace='' Name='Root' Value=NULL''.
2010-11-23 13:54:00.062071 10447 UserTrace BIP4067I: Message propagated to output terminal for trace node 'TestXMLNSCValidationFailureScenario.Trace'.

The trace node 'TestXMLNSCValidationFailureScenario.Trace' has received a message and is propagating it to any nodes c
onnected to its output terminal.
No user action required.
2010-11-23 13:54:00.076204 10447 UserTrace BIP2638I: The MQ output node 'TestXMLNSCValidationFailureScenario.MQOutput' attempted to write a message to
queue ''TEST.OUT'' connected to queue manager ''''. The MQCC was '0' and the MQRC was '0'.
2010-11-23 13:54:00.076224 10447 UserTrace BIP2622I: Message successfully output by output node 'TestXMLNSCValidationFailureScenario.MQOutput' to queu
e ''TEST.OUT'' on queue manager ''''.

Threads encountered in this trace:
10447


In the above example, message "VisaAccountInformationRequestxx" is not defined in the message set.
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Nov 23, 2010 6:54 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Sorry to be picky, but you should use [code] not [quote] when quoting indented text. Otherwise the indentation gets lost.
Back to top
View user's profile Send private message
prasadpav
PostPosted: Tue Nov 23, 2010 8:16 am    Post subject: Reply with quote

Centurion

Joined: 03 Oct 2004
Posts: 142

Code:
<xs:element name="Body" type="soapenv:Body" />

<xs:complexType name="Body">
         <xs:sequence maxOccurs="unbounded">
            <xs:choice>
                  <xs:annotation>
                      <xs:appinfo source="WMQI_APPINFO">     
                          <MRLocalGroup composition="message" content="openDefined" />
                      </xs:appinfo>
                  </xs:annotation>
                  <xs:element ref="soapenv:Fault"/>
            </xs:choice>
         </xs:sequence>
     <xs:anyAttribute namespace="##any" processContents="lax" />
</xs:complexType>

That's much better. Thanks.

Any ideas, why the validation is not behaving as it should for MQInput node?
Back to top
View user's profile Send private message
Amitha
PostPosted: Tue Nov 23, 2010 11:15 am    Post subject: Reply with quote

Voyager

Joined: 20 Nov 2009
Posts: 80
Location: Newyork

Quote:
On MQInput node, the validation options are set to - XMLNSC, Messageset name, format and type are blank, parsing options immediate, validate content and value, throw exception in case of errors".



You need to select the message set from drop down for XMLNSC parser to parse the message against Message set.
Back to top
View user's profile Send private message Send e-mail
kimbert
PostPosted: Tue Nov 23, 2010 11:28 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

prasadpav is setting the Message Set. Here's the proof.
Code:
(0x03000000:NameValue):MessageSet = 'MSGSET_Visa_Account_Information' (CHARACTER)
(0x03000000:NameValue):MessageType = '' (CHARACTER)
(0x03000000:NameValue):MessageFormat = '' (CHARACTER)

You're not the only person to misunderstand this, though:
Quote:
XMLNSC, Messageset name, format and type are blank
prasadpav: please take note!
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Nov 23, 2010 11:45 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

prasadpav: Please can you extract the xsds from the xsdzip and post the relevant part of the actual, deployed xsd.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Nov 23, 2010 1:06 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Quote:
Code:
         </xs:sequence>
     <xs:anyAttribute namespace="##any" processContents="lax" />
</xs:complexType>

Shouldn't it say processContents="strict" /> for what he is trying to do?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
kimbert
PostPosted: Tue Nov 23, 2010 2:02 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

fjb_saper said:
Quote:
Shouldn't it say processContents="strict" />
That processContents attribute is on a wildcard *attribute*. I'm just saying...
Back to top
View user's profile Send private message
prasadpav
PostPosted: Tue Nov 23, 2010 2:13 pm    Post subject: Reply with quote

Centurion

Joined: 03 Oct 2004
Posts: 142

Quote:
On MQInput node, the validation options are set to - XMLNSC, Messageset name, format and type are blank, parsing options immediate, validate content and value, throw exception in case of errors".


Sorry...I didn't made it clear. As you have figured it out...Domain is set to XMLNSC & message set is also set. Only format & type are blank (basically I cannot select them). I'll post the contents of the xsdzip tomorrow morning.
Back to top
View user's profile Send private message
prasadpav
PostPosted: Wed Nov 24, 2010 2:43 am    Post subject: Reply with quote

Centurion

Joined: 03 Oct 2004
Posts: 142

I found the answer after unzipping the deployed message set.
Code:
   <xs:element name="Body" type="soapenv:Body"/>
   <xs:complexType name="Body">

         <xs:sequence maxOccurs="unbounded">
            <xs:sequence>
        <xs:any maxOccurs="unbounded" minOccurs="0" namespace="'urn:mynamespace urn:mynamespace:Party urn:mynamespace:CreditCardAccount urn:mynamespace:Common urn:mynamespace:VisaAccount urn:mynamespace:VisaAccountInformation urn:mynamespace:Address urn:mynamespace:Messages urn:mynamespace:Customer urn:mynamespace:Account http://schemas.xmlsoap.org/soap/envelope/ urn:mynamespace:ProductType" processContents="lax"/>
      </xs:sequence>
        </xs:sequence>
          <xs:anyAttribute namespace="##any" processContents="lax"/>   
         
   </xs:complexType>


It matches *ONLY* the name space but not the element name. Is this how it is supposed to work?

BTW, I realised that our runtime environment is 6.1.0.5 and toolkit do not have any fixpacks applied. I'm trying to get fix packs installed atleast for toolkit.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Msg validation for a service with 2 interfaces - HTTP &
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.