Search in sources :

Example 1 with EbicsRequestDocument

use of com.axelor.apps.account.ebics.schema.h003.EbicsRequestDocument in project axelor-open-suite by axelor.

the class EbicsXmlFactory method createEbicsRequestDocument.

// -----------------------------------------------------------------------------------------------------------------------------------------------
/**
 * Creates a new <code>EbicsRequestDocument</code> XML object
 *
 * @param ebicsRequest the <code>EbicsRequest</code> element
 * @return the <code>EbicsRequestDocument</code> XML object
 */
public static EbicsRequestDocument createEbicsRequestDocument(EbicsRequest ebicsRequest) {
    EbicsRequestDocument newEbicsRequestDocument = EbicsRequestDocument.Factory.newInstance();
    newEbicsRequestDocument.setEbicsRequest(ebicsRequest);
    return newEbicsRequestDocument;
}
Also used : EbicsRequestDocument(com.axelor.apps.account.ebics.schema.h003.EbicsRequestDocument)

Example 2 with EbicsRequestDocument

use of com.axelor.apps.account.ebics.schema.h003.EbicsRequestDocument in project axelor-open-suite by axelor.

the class ReceiptRequestElement method build.

@Override
public void build() throws AxelorException {
    EbicsRequest request;
    Header header;
    Body body;
    MutableHeaderType mutable;
    StaticHeaderType xstatic;
    TransferReceipt transferReceipt;
    SignedInfo signedInfo;
    mutable = EbicsXmlFactory.createMutableHeaderType("Receipt", null);
    xstatic = EbicsXmlFactory.createStaticHeaderType(session.getBankID(), transactionId);
    header = EbicsXmlFactory.createEbicsRequestHeader(true, mutable, xstatic);
    transferReceipt = EbicsXmlFactory.createTransferReceipt(true, 0);
    body = EbicsXmlFactory.createEbicsRequestBody(transferReceipt);
    request = EbicsXmlFactory.createEbicsRequest(1, "H003", header, body);
    document = EbicsXmlFactory.createEbicsRequestDocument(request);
    signedInfo = new SignedInfo(session.getUser(), getDigest());
    signedInfo.build();
    ((EbicsRequestDocument) document).getEbicsRequest().setAuthSignature(signedInfo.getSignatureType());
    ((EbicsRequestDocument) document).getEbicsRequest().getAuthSignature().setSignatureValue(EbicsXmlFactory.createSignatureValueType(signedInfo.sign(toByteArray())));
}
Also used : EbicsRequest(com.axelor.apps.account.ebics.schema.h003.EbicsRequestDocument.EbicsRequest) MutableHeaderType(com.axelor.apps.account.ebics.schema.h003.MutableHeaderType) TransferReceipt(com.axelor.apps.account.ebics.schema.h003.EbicsRequestDocument.EbicsRequest.Body.TransferReceipt) Header(com.axelor.apps.account.ebics.schema.h003.EbicsRequestDocument.EbicsRequest.Header) EbicsRequestDocument(com.axelor.apps.account.ebics.schema.h003.EbicsRequestDocument) StaticHeaderType(com.axelor.apps.account.ebics.schema.h003.StaticHeaderType) Body(com.axelor.apps.account.ebics.schema.h003.EbicsRequestDocument.EbicsRequest.Body)

Aggregations

EbicsRequestDocument (com.axelor.apps.account.ebics.schema.h003.EbicsRequestDocument)2 EbicsRequest (com.axelor.apps.account.ebics.schema.h003.EbicsRequestDocument.EbicsRequest)1 Body (com.axelor.apps.account.ebics.schema.h003.EbicsRequestDocument.EbicsRequest.Body)1 TransferReceipt (com.axelor.apps.account.ebics.schema.h003.EbicsRequestDocument.EbicsRequest.Body.TransferReceipt)1 Header (com.axelor.apps.account.ebics.schema.h003.EbicsRequestDocument.EbicsRequest.Header)1 MutableHeaderType (com.axelor.apps.account.ebics.schema.h003.MutableHeaderType)1 StaticHeaderType (com.axelor.apps.account.ebics.schema.h003.StaticHeaderType)1