Author |
Message
|
SNotes |
Posted: Wed Jan 14, 2015 4:09 am Post subject: XML schema validation error due to name space issue! |
|
|
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 |
|
 |
SNotes |
Posted: Wed Jan 14, 2015 4:11 am Post subject: Valid and invalid requests |
|
|
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 |
|
 |
kimbert |
Posted: Wed Jan 14, 2015 4:59 am Post subject: |
|
|
 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 |
|
 |
SNotes |
Posted: Wed Jan 14, 2015 8:04 am Post subject: |
|
|
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 |
|
 |
kimbert |
Posted: Wed Jan 14, 2015 9:31 am Post subject: |
|
|
 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 |
|
 |
SNotes |
Posted: Thu Jan 15, 2015 2:45 am Post subject: |
|
|
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 |
|
 |
SNotes |
Posted: Tue Jan 20, 2015 11:28 pm Post subject: |
|
|
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 |
|
 |
|