users@jaxb.java.net

Re: Validator throws error for non-mandatory fields

From: Roshan Nair <roshan.nair_at_gmail.com>
Date: Wed, 13 Oct 2004 13:41:27 +0530

Thanks Ryan,

                   I have it figured out now. I was not creating a required
element , OrderLine. The error thrown by the validator threw me
completely off the right track as it mentioned a whole lot of other
elements as being required. Maybe this is where jaxb-verification will
be handy?

                  Once again, thanks for your time.

Roshan Nair.


On Tue, 12 Oct 2004 10:40:48 -0400, Ryan Shoemaker - JavaSoft East
<ryan.shoemaker_at_sun.com> wrote:
> Roshan Nair wrote:
> > Hi,
> > I am working on the UBL sample provided with jaxb (jwsdp
> > 1.4). I used JAXB to create the order form. There are only four
> > elements that are always required (ie minOccurs="1"). These are ID,
> > IssueDate, BuyerParty, SellerParty.
> >
> > I created an Order object with only these four elements.
> > However when validating I get the following error:
> >
> > [java] DefaultValidationEventHandler: [ERROR]: uncompleted content
> > model. expecting:
> > <AllowanceCharge>,<DeliveryTerms>,<DestinationCountry>,<FreightForwarderParty>,<OrderLine>,<SalesConditions>,
> > <org.oasis.ubl.commonaggregatetypes.AllowanceCharge>,<org.oasis.ubl.commonaggregatetypes.DeliveryTerms>,
> > <org.oasis.ubl.commonaggregatetypes.DestinationCountry>,<org.oasis.ubl.commonaggregatetypes.FreightForwarderParty>,
> > <org.oasis.ubl.commonaggregatetypes.OrderLine>,<org.oasis.ubl.commonaggregatetypes.SalesConditions>
> > [java] Location: obj: org.oasis.ubl.order.impl.OrderImpl_at_f0c85e
> > [java] There was a problem validating the order.
> >
> > Now, all these elements have a minOccurs="0". Why do I get this error?
> > Where can I see a list of errors that ValidationEventHandler throws
> > and their interpretations?
> >
>
> It's hard to say without looking at the code.
>
> > The UBL schemas provided with the jwsdp1.4 distro are a subset of an
> > older version of UBL.
>
> JWSDP 1.4 shipped with a sample based on UBL 0p70. The upcoming
> release of JWSDP 1.5 will ship with a sample based on UBL 1.0.
> You can grab a preview release of jaxb[1] and try that instead.
>
> > I am creating the Order object in a single
> > class. I create instances of all the elements that are mandatory
> > within the same class. I don't think the issue is with my code.
> > Its fairly large so I'll post it if someone wants to look at it.
>
> Assuming you didn't modify the binding customizations for the
> schema, you can just send the client code that shows how you are
> building and validating your content tree.
>
> > A similar question (uncompleted content model) was asked earlier but
> > the reply does not help here.
> >
>
> I think that thread was about unmarshalling incomplete XML, which
> is a different beast altogether.
>
> Thanks,
>
> --Ryan
>
> [1] https://jaxb.dev.java.net/servlets/ProjectDocumentList?folderID=460&expandFolder=460&folderID=0
> Grab the " JAXB_RI.class" file.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net