Skip to Content
0
Former Member
Oct 16, 2010 at 05:13 PM

attach an xml to a pdf using ADS

292 Views

Hi all,

I have a scenario where we are sending a Base64 encoded PDF (a bill) and the corresponding xml data from SAP backend on level 4.6C to PI 7.1. In PI we should attach the xml data to the PDF. I have already succeeded to do this using iText but we have a requirement to do this with ADS instead. In Netweaver Developer Studio I created an example project where I am reading a PDF as a byte array, also reading an XML file and try to attach the XML to the PDF using the ADS api. The project successfully built in NWDS but when I am running the project it failes.

I am using standard code to attach the xml stream to the pdf, the error message is thrown when the following line is executed:

IWDPDFDocument document = context.execute();

Exception in thread "main" java.lang.ExceptionInInitializerError

at com.sap.tc.webdynpro.clientserver.adobe.pdfdocument.impl.PDFDocumentAccessibleContextWDImpl.execute(PDFDocumentAccessibleContextWDImpl.java:99)

at com.eon.xi.dijnet.base64.PdfWithAttachment.addAttachmentWithSap(PdfWithAttachment.java:129)

at com.eon.xi.dijnet.base64.PdfWithAttachment.main(PdfWithAttachment.java:218)

Caused by: java.lang.NullPointerException

at com.sap.tc.webdynpro.services.sal.deployment.core.DeployableObjectInternal.getSystemDeployableObjectName(DeployableObjectInternal.java:53)

at com.sap.tc.webdynpro.clientserver.uielib.adobe.impl.AdobeFormHelper.<clinit>(AdobeFormHelper.java:115)

... 3 more

Is it the problem with the PDF that it is not an Interactive Form?

Or the problem is simply that I am trying to run the project on my local machine where ADS is not available?

Thanks for your help.

Pal

Edited by: Pal Somogyi on Oct 17, 2010 10:30 PM

Edited by: Pal Somogyi on Oct 18, 2010 11:44 AM