Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
No replies
SystemAdmin
SystemAdmin
4179 Posts
ACCEPTED ANSWER

Pinned topic Accessing the informaton in Text in ParserException

‏2013-03-25T17:32:44Z |
Scenario: We have an XML Schema which validates the incoming SOAP/XML message. An exception is thrown when a validation fails and the response the caller of the webservice gets is not very useful as it doesn't indicate the field name which failed the validation. So I am trying to extract the "Text" data (from last line in INSERT Text) which indicates the field name and pass it on to the caller. Is this doable?

For example: In the following exception, I am able to get Number:INTEGER:5025, Text:CHARACTER:A schema validation error has occurred while parsing the XML document But what I need is Test_Field_ID which failed validation.

Text:CHARACTER:/XMLNSC/http://schemas.xmlsoap.org/soap/envelope/:Envelope/http://schemas.xmlsoap.org/soap/envelope/:Body/http://TestOperation:TestOps/input1/Test_SYSTEM_INFO/*Test_Field_ID*

*****************************************************************************************The exception**********************************************************************
ParserException
File:CHARACTER:/build/slot1/S800_P/src/MTI/MTIforBroker/GenXmlParser4/ImbXMLNSCDocHandler.cpp
Line:INTEGER:702
Function:CHARACTER:ImbXMLNSCDocHandler::handleParseErrors
Type:CHARACTER:ComIbmSOAPInputNode
Name:CHARACTER:gen/TestOperation#FCMComposite_1_1
Label:CHARACTER:gen.TestOperation.SOAP Input
Catalog:CHARACTER:BIPmsgs
Severity:INTEGER:3
Number:INTEGER:5025
Text:CHARACTER:A schema validation error has occurred while parsing the XML document
Insert
Type:INTEGER:2
Text:CHARACTER:6005
Insert
Type:INTEGER:2
Text:CHARACTER:2
Insert
Type:INTEGER:2
Text:CHARACTER:8
Insert
Type:INTEGER:2
Text:CHARACTER:78
Insert
Type:INTEGER:5
Text:CHARACTER:cvc-maxLength-valid: The length of value "000000003" is "9" which is not valid with respect to maxLength facet with value "8" for type "#Anonymous".
Insert
Type:INTEGER:5
Text:CHARACTER:/XMLNSC/http://schemas.xmlsoap.org/soap/envelope/:Envelope/http://schemas.xmlsoap.org/soap/envelope/:Body/http://TestOperation:TestOps/input1/Test_SYSTEM_INFO/Test_Field_ID