-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for the creation of Receipts #6
Comments
Line 130 of XeroClient has |
Hi Ben I am having a problem where strange schema lines are being added to the XML to be posted to Xero when I don't specify certain non-manatory fields, e.g. TaxAmount. I have tested the XML in the API Previewer and it returns an error. If these lines are removed then all is ok. Do you have any idea what is causing this? Thanks Richard
|
Nope, haven't seen this before. Let me know if you find out though |
Had to remove nillable=true from fields in LineItem.xsd.
|
@onevision @andrewsnowden does removing Please be sure to test this change with creating and fetching invoices, bank transactions, and receipts |
No, I removed nillable="true" to stop weird schema lines being added to the posted XML. The fields were still not mandatory |
The 'weird schema lines being added to the posted XML' are due to JAXB trying to do the right thing with respect to the
So the effect of 'nillable' in a data-binding situation is to panic the 'XSD processor' into a line of thought like:
So the question becomes whether Xero-the-API would prefer empty elements or no elements when there is nothing to say (and it's allowed). If it prefers no elements at all, then using 'minOccurs=0' and NOT marking it 'nillable' is the right way to go. If it prefers empty elements over absent ones, then 'minOccurs>0' and either:
Occam's razor says But what we don't need is |
Laid into 'em with XeroAPI/XeroAPI-Schemas#33 |
My company needs a command line tool to create Receipts in Xero, so I thought I would extend xero-java-client to support the creation of invoices.
So have I have made the following change to Receipt.xsd in XeroAPI-Schemas
And the following change to XeroClient.java in xero-java-client
However I an struggling to get Xero to create the Receipt. If I run the following code:
I get the error
Is there a way I can see the actual XML being sent to Xero?
thanks
Richard
The text was updated successfully, but these errors were encountered: