Examples of SwsMissingRequiredElementInResponseException


Examples of no.sws.client.SwsMissingRequiredElementInResponseException

    if(element != null && element.getTextTrim().length() > 0) {
      return element.getTextTrim();
    }
    else if(required) {
      throw new SwsMissingRequiredElementInResponseException(elementName, XmlUtils.xmlElement2String(parent, Format.getPrettyFormat()));
    }
    else {
      return null;
    }
  }
View Full Code Here

Examples of no.sws.client.SwsMissingRequiredElementInResponseException

      // get the lines element
      final Element linesElement = invoiceElement.getChild("lines");

      if(linesElement == null) {
        throw new SwsMissingRequiredElementInResponseException("lines", XmlUtils.xmlElement2String(invoiceElement, Format.getPrettyFormat()));
      }

      // get the line elements
      final List<Element> lineElements = linesElement.getChildren("line");

      if(lineElements == null || lineElements.size() == 0) {
        throw new SwsMissingRequiredElementInResponseException("line", XmlUtils.xmlElement2String(invoiceElement, Format.getPrettyFormat()));
      }

      final List<InvoiceLine> invoiceLines = new LinkedList<InvoiceLine>();

      for(final Element currentLineElement : lineElements) {
View Full Code Here

Examples of no.sws.client.SwsMissingRequiredElementInResponseException

      // get the optional element
      final Element optionalElement = invoiceElement.getChild("optional");

      if(optionalElement == null) {
        throw new SwsMissingRequiredElementInResponseException("optional", XmlUtils.xmlElement2String(invoiceElement, Format
            .getPrettyFormat()));
      }

      invoice.setInvoiceType(InvoiceType.valueOf(getElementValue(optionalElement, "invoiceType", true)));
View Full Code Here

Examples of no.sws.client.SwsMissingRequiredElementInResponseException

    Element child = element.getChild(name);
 
    if(child == null) {
     
      if(required) {
        throw new SwsMissingRequiredElementInResponseException("name", "recipient");
      }
      else {
        return null;
      }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.