CashBookEntry_CreateFromData throws exception

Forum for discussing SOAP, and how it is used in the E-conomic API

CashBookEntry_CreateFromData throws exception

Postby jespr » Sun Sep 11, 2011 1:28 pm

Why does the following

Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:economic="http://e-conomic.com" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
  <env:Body>
    <economic:CashBookEntry_CreateFromData>
      <economic:data>
        <economic:Type>FinanceVoucher</economic:Type>
        <economic:CashBookHandle>
          <economic:Number>1</economic:Number>
        </economic:CashBookHandle>
        <economic:AccountHandle>
          <economic:Number>1010</economic:Number>
        </economic:AccountHandle>
        <economic:ContraAccountHandle>
          <economic:Number>1011</economic:Number>
        </economic:ContraAccountHandle>
        <economic:Date>2011-09-11T13:17:02+02:00</economic:Date>
        <economic:VoucherNumber>11234</economic:VoucherNumber>
        <economic:Text>test</economic:Text>
        <economic:AmountDefaultCurrency>42</economic:AmountDefaultCurrency>
        <economic:CurrencyHandle>
          <economic:Code>DKK</economic:Code>
        </economic:CurrencyHandle>
        <economic:Amount>100</economic:Amount>
        <economic:DebtorInvoiceNumber xsi:nil="true"/>
        <economic:CreditorInvoiceNumber xsi:nil="true"/>
        <economic:DueDate>2011-09-11T13:17:17+02:00</economic:DueDate>
        <economic:BankPaymentCreditorId>0</economic:BankPaymentCreditorId>
        <economic:BankPaymentCreditorInvoiceId>0</economic:BankPaymentCreditorInvoiceId>
        <economic:StartDate>2011-09-11T13:17:02+02:00</economic:StartDate>
        <economic:EndDate>2011-09-11T13:17:22+02:00</economic:EndDate>
      </economic:data>
    </economic:CashBookEntry_CreateFromData>
  </env:Body>
</env:Envelope>



Result in this error:

<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><faultcode>soap:Client</faultcode><faultstring>Economic.Api.Exceptions.SchemaException(E00500): If the 'nillable' attribute is false in the schema, the 'xsi:nil' attribute must not be present in the instance. {id=1775947948}</faultstring><detail /></soap:Fault></soap:Body></soap:Envelope>

At the same time, I get an error if I set DebtorInvoiceNumber og CreditorInvoiceNumber to anything but nil.
-
jespr
 
Posts: 1
Joined: Sun Sep 11, 2011 1:20 pm

Re: CashBookEntry_CreateFromData throws exception

Postby Christian Estrup » Mon Sep 12, 2011 9:27 am

Hi,

CreditorInvoiceNumber is not 'nillable' per se - but you should be allowed to set it to the empty string.

In any case, note that neither DebtorInvoiceNumber, CreditorInvoiceNumber nor DueDate are relevant if the entry type is FinanceVoucher.


Best regards,
Christian Estrup
Chief Architect

Image
Online accounting
User avatar
Christian Estrup
 
Posts: 245
Joined: Tue Jun 09, 2009 6:37 pm


Return to SOAP



cron