Monday, April 18, 2016

MDMDomains.xsd | MDMCommon.xsd | Parser Error

Problem(Abstract)

When any extension XSD refers to types in the MDMDomains.xsd, all transactions that use the MDMCommon.xsd will fail with the error "Parser DWLTransaction failed. The format of the message is not correct or an application error occurred".

Symptom

All transactions that use the MDMCommon.xsd fail and return the error "Parser DWLTransaction failed. The format of the message is not correct or an application error occurred." The Throwable attribute in the response always says "Cannot resolve the name 'XXXXXX' to a(n) 'element declaration' component." regardless what request is about. An example of such response looks like below:
<DWLError>
<ComponentType>106</ComponentType>
<ErrorMessage>Parser DWLTransaction failed. The format of the message is not correct or an application error occurred.</ErrorMessage>
<ErrorType>READERR</ErrorType>
<LanguageCode>100</LanguageCode>
<ReasonCode>4928</ReasonCode>
<Severity>0</Severity>
<Throwable>com.dwl.base.requestHandler.exception.RequestParserException: src-resolve: Cannot resolve the name &apos;ProductBObj&apos; to a(n) &apos;element declaration&apos; component.</Throwable>
</DWLError>

Cause

If the request XML uses the MDMDomains.xsd then the problem won't occur. Batch processor will also fail in such case since it runs transactions internally to maintain its state and these transactions use MDMCommon.xsd.

The entity resolver of the request xml parser collects and combines all the extension XSDs (i.e. xsd-fragements) with no regard for which XSD the request XML uses. When the request XML uses MDMCommon.xsd, however, there is an extension XSD that refers to types in the MDMDomain.xsd, the combined XSD becomes invalid, which causes the problem.

Resolving the problem

If the client runs transactions directly, then changing the request xml to use MDMDomains.xsd instead of MDMCommon.xsd should work.

If the client runs transactions through batch processor, then both the request xmls in the batch input file or request xml templates and the batch processor internal transaction templates (all files in <batch_home>/templates/* folders) need to be changed to use MDMDomains.xsd instead of MDMCommon.xsd.

No comments:

Post a Comment