|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Schema validation error |
« View previous topic :: View next topic » |
Author |
Message
|
mpong |
Posted: Tue Apr 25, 2017 2:19 pm Post subject: Schema validation error |
|
|
Disciple
Joined: 22 Jan 2010 Posts: 164
|
IIB is receiving a SOAP request message from the caller systems and input request is validated against xsd. Strangely for one of caller system request is failing due to schema validation though the request is valid.
When I troubleshoot on SOAP UI, the only change that makes it as valid request is below encodingStyle attribute.
Caller system request headers:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
Modified request headers:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
The way they have declared encodingStyle is causing the issue but it valid as per w3c https://www.w3schools.com/xml/xml_soap.asp and they do not want to change anything on their side (As always).
In order to parse this msg, I need to set the validation as None on the soap request node but then I can not validate the message against xsd. (Unless i do something using java or something else)
Please suggest your thoughts. |
|
Back to top |
|
 |
timber |
Posted: Tue Apr 25, 2017 2:55 pm Post subject: |
|
|
 Grand Master
Joined: 25 Aug 2015 Posts: 1292
|
Quote: |
request is failing due to schema validation though the request is valid. |
That might be true, but you have not supplied any evidence. Please quote the full text of the validation error.
Quote: |
When I troubleshoot on SOAP UI, the only change that makes it as valid request is below encodingStyle attribute. |
Well, ...you have changed the encodingStyle attribute into a namespace declaration. So you have made the error go away, but your SOAP envelope no longer contains an encodingStyle attribute! |
|
Back to top |
|
 |
mpong |
Posted: Tue Apr 25, 2017 9:36 pm Post subject: |
|
|
Disciple
Joined: 22 Jan 2010 Posts: 164
|
Below is the ExceptionList, when i set the encodingStyle attribute as xmlns:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" instead of SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" it works.
[quote]Number:INTEGER:5025
Text:CHARACTER:A schema validation error has occurred while parsing the XML document
Insert
Type:INTEGER:2
Text:CHARACTER:5012
Insert
Type:INTEGER:2
Text:CHARACTER:1
Insert
Type:INTEGER:2
Text:CHARACTER:1
Insert
Type:INTEGER:2
Text:CHARACTER:245
Insert
Type:INTEGER:5
Text:CHARACTER:cvc-complex-type.3.2: Attribute "SOAP-ENV:encodingStyle" is not allowed to appear in element "SOAP-ENV:Envelope".
Insert
Type:INTEGER:5
Text:CHARACTER:/XMLNSC[/quote]
------------------------------------ |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Apr 25, 2017 10:42 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Did you notice in the SOAP envelope, in the example you gave showing that the encoding style was valid, what the SOAP Envelope namespace was?
In your flow you are using SOAP version 1.1 but the encoding Style is not valid in SOAP 1.1. You need a higher version of SOAP for the encoding style to be valid and as such you have to tell the message broker that you want a higher version of SOAP...
Code: |
<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2003/05/soap-envelope/"
soap:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
<soap:Header>
...
</soap:Header>
<soap:Body>
...
<soap:Fault>
...
</soap:Fault>
</soap:Body>
</soap:Envelope>
|
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
mpong |
Posted: Wed Apr 26, 2017 8:49 am Post subject: |
|
|
Disciple
Joined: 22 Jan 2010 Posts: 164
|
Thanks for the advice. Since I do not need the namespace, I have used to soap extract node to remove the namespace and then I used validate node to validate the message against xsd. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|