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 IndexWebSphere Message Broker SupportSchema validation error

Post new topicReply to topic
Schema validation error View previous topic :: View next topic
Author Message
mpong
PostPosted: Tue Apr 25, 2017 2:19 pm Post subject: Schema validation error Reply with quote

Centurion

Joined: 22 Jan 2010
Posts: 141

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
View user's profile Send private message
timber
PostPosted: Tue Apr 25, 2017 2:55 pm Post subject: Reply with quote

Sentinel

Joined: 25 Aug 2015
Posts: 854

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
View user's profile Send private message
mpong
PostPosted: Tue Apr 25, 2017 9:36 pm Post subject: Reply with quote

Centurion

Joined: 22 Jan 2010
Posts: 141

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
View user's profile Send private message
fjb_saper
PostPosted: Tue Apr 25, 2017 10:42 pm Post subject: Reply with quote

Grand Poobah

Joined: 18 Nov 2003
Posts: 19758
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
View user's profile Send private message Send e-mail
mpong
PostPosted: Wed Apr 26, 2017 8:49 am Post subject: Reply with quote

Centurion

Joined: 22 Jan 2010
Posts: 141

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
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexWebSphere Message Broker SupportSchema validation error
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.