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 schema validation error due to name space issue!

Post new topic  Reply to topic
 XML schema validation error due to name space issue! « View previous topic :: View next topic » 
Author Message
SNotes
PostPosted: Wed Jan 14, 2015 4:09 am    Post subject: XML schema validation error due to name space issue! Reply with quote

Newbie

Joined: 14 Jan 2015
Posts: 5

Hello All ,

I have flow where I am receiving SOAP message over MQ. This SOAP message got validated correctly in SOAP UI tool ,but failing the validation on Validation/RCD Node.

Following request gets Failed (If I remove Namespaces declaration from <soapenv:Envelope> element and mentioned at Operation Element <not:RCFRequest> then same request gets validated by Validation Node.)



Below is flow structure.

Code:
MQInput Node -----------> SOAP Extract Node ----------->   Validate Node -------->MQOutput Node
"Content and Value"         SOAP Envelope removed           Domain :XMLNSC
Validation Set,            Name spaces are declared         Message Set mentioned 
Message set mentioned      at <soap-envelope> element       Check Domain ,Check Set enabled
Domain set as XMLNSC


Below is the Exception got from Event Viewer
Code:
( MB7BROKER.Test ) XML schema validation error: 'cvc-type.2: The type definition cannot be abstract for element "NS1:CustInfo".'   
 Element: '/Root/XMLNSC'   
 Internal error codes: '5024', '2'.   
 Line: '3', Column: '277'   

This error was reported by the XMLNSC parser. The message tree is not valid according to the message definitions in the message set.   

The message tree is not valid according to the message definition files in the message set.   
 - Check that the elements and attributes in the message tree are declared in the message set.   
 - Check that all attributes in the message tree have been cast as (XMLNSC.Attribute) in the message tree.   
 - Check that any values of types gDate, gYear, gMonth, gDay, gYearMonth, gMonthDay have been cast as (XMLNSC.gDate), (XMLNSC.gYear) and so on, in the message tree.   
 - Check that any values of type base64Binary have been cast as (XMLNSC.base64Binary) in the message tree.   
 The message tree is converted to an XML bitstream before being validated. The line and column number are the coordinates of the error in the XML bit stream.


Local Broker version : 7.0.0.4
Dev Broker Version : 7.0.0.6


Below are some observations and queries I could not get anser for
1. I have Enbaled Validation at MQInput Node then the Message which fails the at Validation Node why it is not failing at MQInput node ?
2. If I remove Namescapces declaration from <soapenv:Envelope> element and declare at Operation Element <not:RCFRequest> then same request gets validated by Validation Node. Is it SOAP Extract node causing exception ?

Appreciate your time and Suggestions!!
Back to top
View user's profile Send private message
SNotes
PostPosted: Wed Jan 14, 2015 4:11 am    Post subject: Valid and invalid requests Reply with quote

Newbie

Joined: 14 Jan 2015
Posts: 5

Following request gets Failed (If I remove Namespaces declaration from <soapenv:Envelope> element and mentioned at Operation Element <not:RCFRequest> then same request gets validated by Validation Node.)

Code:
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
              xmlns:not="http://www.abc.co.in/Not"
              xmlns:head="http://abc.com/Header"
              xmlns:com="http://www.abc.co.in/Common">
  <soapenv:Body>
    <not:RCFRequest>
    ......
     <not:CustInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="com:RegCustType">
        <com:BId>ABC</com:BusinessId>
        <com:CId>1234566</com:CustomerId>
      </not:CustInfo>
   ......
   </not:RCFRequest>
  </soapenv:Body>
</soapenv:Envelope>


Following requests gets Validated by Validation Node.
Code:
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
  <soapenv:Body>
    <not:RCFRequest xmlns:not="http://www.abc.co.in/Not"
                              xmlns:head="http://abc.com/Header"
                              xmlns:com="http://www.abc.co.in/Common">
    ......
    <not:CustInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="com:RegCustType">
        <com:BId>ABC</com:BusinessId>
        <com:CId>1234566</com:CustomerId>
      </not:CustInfo>
   ......
   </not:RCFRequest>
  </soapenv:Body>
</soapenv:Envelope>
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Jan 14, 2015 4:59 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

When you remove the SOAP envelope you are also removing the namespace declarations that were located on the <soapenv:Envelope> tag. One of those declarations is
Code:
xmlns:com="http://www.abc.co.in/Common"
which is used later in the message in the value of the xsi:type attribute:
Code:
<not:CustInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="com:RegCustType">
The solution is to put the namespace declaration for 'com' onto the soap Body element before the Validate node.
_________________
Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too.
Back to top
View user's profile Send private message
SNotes
PostPosted: Wed Jan 14, 2015 8:04 am    Post subject: Reply with quote

Newbie

Joined: 14 Jan 2015
Posts: 5

Thanks Kimbert for Quick Reply.

I think this issue is related to the Message set which is generated using the WSDL which we received for Development
Reason behind this thinking is there are many other message flows which receives the messages where namespaces are declared at
<soapenv:Envelope> element and still they got validated at Validate node even after SOAP-Extract node removes the NameSpaces.

As per the below infocenter Link Name spaces will automatically gets applied to Operation contain in the Soap Body ,if my interpretation is correct

http://www-01.ibm.com/support/knowledgecenter/api/content/nl/en-us/SSKM8N_7.0.0/com.ibm.etools.mft.doc/ac60010_.htm#ac60010_examples

Thanks again for your time and Suggetions!!
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Jan 14, 2015 9:31 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
I think this issue is related to the Message set which is generated using the WSDL which we received for Development
What do you think is wrong with the message set?
_________________
Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too.
Back to top
View user's profile Send private message
SNotes
PostPosted: Thu Jan 15, 2015 2:45 am    Post subject: Reply with quote

Newbie

Joined: 14 Jan 2015
Posts: 5

We had WSDL and corresponding Messsage Set which is working fine (Validating messages having namesapces declared in <soap-envelope> element level after SOAP-Extract node MQInput ---> SOAP Extract --->Validation Node).It has been working fine since long time.
As new requirements come, WSDL gets updated ( new extensions/changes gets added in XSD which are imported in WSDL) . Now we try this new updated WSDL/Message Set we started getting this issue.


In Event viewer I got the

Code:

( MB7BROKER.Test ) XML schema validation error: 'cvc-type.2: The type definition cannot be abstract for element "NS1:CustInfo".'   
 Element: '/Root/XMLNSC'   
 Internal error codes: '5024', '2'.   
 Line: '3', Column: '277'   

This error was reported by the XMLNSC parser. The message tree is not valid according to the message definitions in the message set


If SOAP Extract node is removing the namespaces then it should have failed at <not:RCFRequest> saying unable to resolve namespace "not"

Code:

<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
              xmlns:not="http://www.abc.co.in/Not"
              xmlns:head="http://abc.com/Header"
  <soapenv:Body>
    <not:RCFRequest>
    ......
     <not:CustInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="com:RegCustType">
        <com:BId>ABC</com:BusinessId>
        <com:CId>1234566</com:CustomerId>
      </not:CustInfo>
   ......
   </not:RCFRequest>
  </soapenv:Body>
</soapenv:Envelope>


This is making me think that it is related to Message Set /WSDL issue .Something we are missing causing this exception.
Back to top
View user's profile Send private message
SNotes
PostPosted: Tue Jan 20, 2015 11:28 pm    Post subject: Reply with quote

Newbie

Joined: 14 Jan 2015
Posts: 5

We handled this issue by enabling the Validation of the message at MQInput Node and connecting the Failure terminal to the Exception Handling flow.In this case there is no need to have Validate node which was causing throwing exception .
Thank you for your time and suggestions!!.
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 » XML schema validation error due to name space issue!
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.