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

Problem saving CurrentInvoices

0
Hi, I've created a jar of the generated classes from Axis and i've not changed the generated classes in any way.

Now i've run into problems with the api .. the following code
import come_conomicCurrentInvoiceData;
import come_conomicDebtorHandle;
import come_conomicEconomicWebServiceLocator;
import come_conomicEconomicWebServiceSoap;

import javaxxmlrpcServiceException;
import javarmiRemoteException;
import javautilCalendar;

public class CurrentInvoiceExample {
  private static EconomicWebServiceSoap session = null;

  public static EconomicWebServiceSoap session() throws ServiceException, RemoteException {
    if (session == null) {
      EconomicWebServiceLocator locator = new EconomicWebServiceLocator();
      locatorsetMaintainSession(true);
      session = locatorgetEconomicWebServiceSoap();
      sessionconnect(1111, xx, xxx);
    }
    return session;
  }

  public static void main(String args) throws ServiceException, RemoteException {
    DebtorHandle debtorHandle = session()debtor_GetAll()0;
    CurrentInvoiceData cid = new CurrentInvoiceData();
    cidsetDate(CalendargetInstance());
    cidsetDebtorHandle(debtorHandle);

    session()currentInvoice_CreateFromData(cid);
  }
}



gives the following error:

Exception in thread main AxisFault
 faultCode {http//schemasxmlsoaporg/soap/envelope/}Client
 faultSubcode
 faultString EconomicApiExceptionsSchemaException(E00500) The element 'data' in namespace 'http//e-conomiccom' has invalid child element 'ExchangeRate' in namespace 'http//e-conomiccom' List of possible elements expected 'TermOfPaymentHandle, DueDate' in namespace 'http//e-conomiccom' {id=730740575}
 faultActor
 faultNode
 faultDetail
        {http//xmlapacheorg/axis/}stackTraceEconomicApiExceptionsSchemaException(E00500) The element 'data' in namespace 'http//e-conomiccom' has invalid child element 'ExchangeRate' in namespace 'http//e-conomiccom' List of possible elements expected 'TermOfPaymentHandle, DueDate' in namespace 'http//e-conomiccom' {id=730740575}
        at orgapacheaxismessageSOAPFaultBuildercreateFault(SOAPFaultBuilderjava222)
        at orgapacheaxismessageSOAPFaultBuilderendElement(SOAPFaultBuilderjava129)
        at orgapacheaxisencodingDeserializationContextendElement(DeserializationContextjava1087)
        at comsunorgapachexercesinternalparsersAbstractSAXParserendElement(AbstractSAXParserjava633)
        at comsunorgapachexercesinternalimplXMLNSDocumentScannerImplscanEndElement(XMLNSDocumentScannerImpljava719)
        at comsunorgapachexercesinternalimplXMLDocumentFragmentScannerImpl$FragmentContentDispatcherdispatch(XMLDocumentFragmentScannerImpljava1685)
        at comsunorgapachexercesinternalimplXMLDocumentFragmentScannerImplscanDocument(XMLDocumentFragmentScannerImpljava368)
        at comsunorgapachexercesinternalparsersXML11Configurationparse(XML11Configurationjava834)
        at comsunorgapachexercesinternalparsersXML11Configurationparse(XML11Configurationjava764)
        at comsunorgapachexercesinternalparsersXMLParserparse(XMLParserjava148)
        at comsunorgapachexercesinternalparsersAbstractSAXParserparse(AbstractSAXParserjava1242)
        at javaxxmlparsersSAXParserparse(SAXParserjava375)
        at orgapacheaxisencodingDeserializationContextparse(DeserializationContextjava227)
        at orgapacheaxisSOAPPartgetAsSOAPEnvelope(SOAPPartjava696)
        at orgapacheaxisMessagegetSOAPEnvelope(Messagejava435)
        at orgapacheaxishandlerssoapMustUnderstandCheckerinvoke(MustUnderstandCheckerjava62)
        at orgapacheaxisclientAxisClientinvoke(AxisClientjava206)
        at orgapacheaxisclientCallinvokeEngine(Calljava2784)
        at orgapacheaxisclientCallinvoke(Calljava2767)
        at orgapacheaxisclientCallinvoke(Calljava2443)
        at orgapacheaxisclientCallinvoke(Calljava2366)
        at orgapacheaxisclientCallinvoke(Calljava1812)
        at come_conomicEconomicWebServiceSoapStubcurrentInvoice_CreateFromData(EconomicWebServiceSoapStubjava44260)
        at CurrentInvoiceExamplemain(CurrentInvoiceExamplejava29)

        {http//xmlapacheorg/axis/}hostnameYodalocal

EconomicApiExceptionsSchemaException(E00500) The element 'data' in namespace 'http//e-conomiccom' has invalid child element 'ExchangeRate' in namespace 'http//e-conomiccom' List of possible elements expected 'TermOfPaymentHandle, DueDate' in namespace 'http//e-conomiccom' {id=730740575}
        at orgapacheaxismessageSOAPFaultBuildercreateFault(SOAPFaultBuilderjava222)
        at orgapacheaxismessageSOAPFaultBuilderendElement(SOAPFaultBuilderjava129)
        at orgapacheaxisencodingDeserializationContextendElement(DeserializationContextjava1087)
        at comsunorgapachexercesinternalparsersAbstractSAXParserendElement(AbstractSAXParserjava633)
        at comsunorgapachexercesinternalimplXMLNSDocumentScannerImplscanEndElement(XMLNSDocumentScannerImpljava719)
        at comsunorgapachexercesinternalimplXMLDocumentFragmentScannerImpl$FragmentContentDispatcherdispatch(XMLDocumentFragmentScannerImpljava1685)
        at comsunorgapachexercesinternalimplXMLDocumentFragmentScannerImplscanDocument(XMLDocumentFragmentScannerImpljava368)
        at comsunorgapachexercesinternalparsersXML11Configurationparse(XML11Configurationjava834)
        at comsunorgapachexercesinternalparsersXML11Configurationparse(XML11Configurationjava764)
        at comsunorgapachexercesinternalparsersXMLParserparse(XMLParserjava148)
        at comsunorgapachexercesinternalparsersAbstractSAXParserparse(AbstractSAXParserjava1242)
        at javaxxmlparsersSAXParserparse(SAXParserjava375)
        at orgapacheaxisencodingDeserializationContextparse(DeserializationContextjava227)
        at orgapacheaxisSOAPPartgetAsSOAPEnvelope(SOAPPartjava696)
        at orgapacheaxisMessagegetSOAPEnvelope(Messagejava435)
        at orgapacheaxishandlerssoapMustUnderstandCheckerinvoke(MustUnderstandCheckerjava62)
        at orgapacheaxisclientAxisClientinvoke(AxisClientjava206)
        at orgapacheaxisclientCallinvokeEngine(Calljava2784)
        at orgapacheaxisclientCallinvoke(Calljava2767)
        at orgapacheaxisclientCallinvoke(Calljava2443)
        at orgapacheaxisclientCallinvoke(Calljava2366)
        at orgapacheaxisclientCallinvoke(Calljava1812)
        at come_conomicEconomicWebServiceSoapStubcurrentInvoice_CreateFromData(EconomicWebServiceSoapStubjava44260)
        at CurrentInvoiceExamplemain(CurrentInvoiceExamplejava29)
created Dec 16, 2009 by briandemant
0% Accept Rate
Q 1 A 0 C 0

1 Answer

0
You need to set all properties on your CurrentInvoiceData explicitly. This includes e.g. ExchangeRate and TermOfPayment.


Regards,

Christian Estrup
e-conomic
answered Dec 16, 2009 by Christian Estrup
Visma e-conomic A/S
...