Discussion

712
Views
PaoloS82 Member since 2014 4 posts
Posted: September 2, 2015
Last activity: September 2, 2015
Closed

XSD validation

Hello,

I am trying to validate an incoming XML request against an XSD where I have two type of messages.

One part is common to the two types, the second is specific for each request.

Here two example XMLs:

<?xml version="1.0" encoding="UTF-8"?>
<bpm:agentOfferLobRequest xmlns:bpm="BPMSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="BPMSchema agentOfferRequestsSplitV1.0.xsd">
    <baseRequest>
        <header>
            <dateTimeCreation>2001-12-17T09:30:47Z</dateTimeCreation>
            <requestor>String</requestor>
            <requestorEmail>james.sleightholm@zurich.com</requestorEmail>
        </header>
        <offerRequest>
            <deadline>2001-12-17T09:30:47Z</deadline>
            <language>fr</language>
            <attachments>
                <mime-type>String</mime-type>
                <filename>String</filename>
                <content>UjBsR09EbGhjZ0dTQUxNQUFBUUNBRU1tQ1p0dU1GUXhEUzhi</content>
            </attachments>
            <notes>String</notes>
        </offerRequest>
        <UOVST>10600</UOVST>
    </baseRequest>
    <lobRequest>
        <LOB>TV</LOB>
        <customerID>String</customerID>
    </lobRequest>
</bpm:agentOfferLobRequest>

 

<?xml version="1.0" encoding="UTF-8"?>
<!--Sample XML file generated by XMLSpy v2015 rel. 4 sp1 (http://www.altova.com)-->
<bpm:agentOfferSubRequest xmlns:bpm="BPMSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="BPMSchema agentOfferRequestsSplitV1.0.xsd">
    <baseRequest>
        <header>
            <dateTimeCreation>2001-12-17T09:30:47Z</dateTimeCreation>
            <requestor>String</requestor>
            <requestorEmail>james.sleightholm@zurich.com</requestorEmail>
        </header>
        <offerRequest>
            <deadline>2001-12-17T09:30:47Z</deadline>
            <language>it</language>
            <attachments>
                <mime-type>String</mime-type>
                <filename>String</filename>
                <content>UjBsR09EbGhjZ0dTQUxNQUFBUUNBRU1tQ1p0dU1GUXhEUzhi</content>
            </attachments>
            <notes>String</notes>
        </offerRequest>
    </baseRequest>
    <contract>
        <businessType>String</businessType>
        <policyID>String</policyID>
    </contract>
</bpm:agentOfferSubRequest>

 

Unfortunately if I parse the first request (LobRequest) using the XSD of the second (SubRequest) I do not get any error: I simply get the "baseRequest" item back, the rest seems to be ignored.

Can anybody help here? Am I doing somehting wrong?

Thanks a lot in advance

Paolo

 

 

Pega Academy
Moderation Team has archived post
Share this page LinkedIn