API Forum

This forum is in read-only mode.
Please refer to our API support in case you have any questions.
We can be reached at api@e-conomic.com
e-conomic API developer forum

Order_CreateFromData throws exception with 'had invalid child element "DebtorHandle"'

0

Hi!

I hope you guess can help me with this Order creation problem.
It seems that no matter what properties I set on the order, I get this error.

Response looks like:

Economic.Api.Exceptions.SchemaException(E00500): The element 'data' in namespace 'http://e-conomic.com' has invalid child element 'DebtorHandle' in namespace 'http://e-conomic.com'. List of possible elements expected: 'DebtorName, DebtorAdd
ress, DebtorPostalCode, DebtorCity, DebtorCountry, DebtorEan, PublicEntryNumber, AttentionHandle, YourReferenceHandle, OurReferenceHandle, OurReference2Handle, Date' in namespace 'http://e-conomic.com'. (id=d2c70ca7-9eef-413f-898f-336e3f82ce6b)
 

Request looks like this:

<?xml version="1.0" encoding="UTF-8"?>
  <env:Body>
    <tns:Order_CreateFromData>
      <tns:data>
        <tns:Id>0</tns:Id>
        <tns:Number>77777</tns:Number>
        <tns:DebtorHandle>
          <tns:Number>984762929</tns:Number>
        </tns:DebtorHandle>
        <tns:DebtorName xsi:nil="true"/>
        <tns:Date>2016-03-07T15:36:03+01:00</tns:Date>
        <tns:DueDate xsi:nil="true"/>
        <tns:ExchangeRate>100</tns:ExchangeRate>
        <tns:IsVatIncluded xsi:nil="true"/>
        <tns:DeliveryDate xsi:nil="true"/>
        <tns:NetAmount>0</tns:NetAmount>
        <tns:VatAmount>0</tns:VatAmount>
        <tns:GrossAmount>0</tns:GrossAmount>
        <tns:Margin>0</tns:Margin>
        <tns:MarginAsPercent>0</tns:MarginAsPercent>
      </tns:data>
    </tns:Order_CreateFromData>
  </env:Body>
</env:Envelope>
 
Can you help me correct the request, and pin-point me, so that I include all the requireded properties, in the request, for the request to succeed?
 
Thank!
created Mar 7, 2016 by mathiasjakobsen
33% Accept Rate
Q 3 A 0 C 3

1 Answer

0
 
Best answer
Hi Mathias

You're deviating from schema which throws off the validation.

https://api.e-conomic.com/secure/api1/EconomicWebService.asmx?op=Order_CreateFromData

For starters you haven't defined handle. But please use the wsdl for full schema reference.
https://api.e-conomic.com/secure/api1/EconomicWebService.asmx?wsdl

Edit: Solution found via API support. It is crucial that the elements come in the same order in the XML as defined by the WSDL. The cause here was scrambled order of the elements.
answered Mar 14, 2016 by olej
selected Apr 15, 2016 by olej
Hi Olej,

Even though I alter the request to have all required elements, I still get the error. Even if I fetch an existing Order, removes the Id and tries to create from the exact same data, the error occours. Do you have acces too the API logs, so that you can help me solve this?
Visma e-conomic A/S
...