Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

NullPointerException converting Native to PDF

ida_raski
Level 2
Level 2

When I try to convert a native document via a webservice I get following NullPointerException.

If I do this invoke via a watched folder, everything works fine. How come? Can anyone help me with this?

Thanks in advance.

Kristof

7 Replies
Hodmi
Level 8
Level 8

Generally that means that the document that you want to convert is not being set in the SOAP message correctly.  What method are you using to send the document (base64, MTOM, url, etc)?

ida_raski
Level 2
Level 2

I'm using soapUI to send the request.

The binaryData refers to the attached word document.

Hodmi
Level 8
Level 8

The LiveCycle SOAP endpoint needs to know in what format the Document BLOB is being sent.  I'm not sure how to do that in your tool, but in java or .NET applications you set the SOAP endpoint to reflect the type of BLOB that it is returning using the blob= clause:

http://<your_serverhost>:<your_port>/soap/services/<service
    name>?blob=base64|dime|mime|http|mtom|swaref

http://help.adobe.com/en_US/livecycle/9.0/programLC/help/index.htm?content=000518.html#1548279

ida_raski
Level 2
Level 2

Thanks for your reply.

Ok, I haven't thought of that. I changed it to MIME but everything is just the same.

The problem is not the fact that the document is not received properly. Because it is.

Everything works fine until the step of converting.

Take a look at my screenshots: inDoc is the variable that contains the document, it is received well and when I open it everything looks fine.

But at the step of converting everything is set to <empty> and a NullPointerException is thrown.

Any idea why?

Thanks,

Kristof

Hodmi
Level 8
Level 8

Ah, that's a different kettle of fish.

I wouldn't worry about all of the variables being <empty> after the error.  That's really just an artifact of the error in workbench.  The variables are shown after the selected step is executed.  If there is an error the variables are marked as empty.

Since it works when you call it using the watched folder, I suspect its something the document object settings rather than the content.  I noticed that your screen shot the content is set (Lenght) and the content type is set, but there is no file name or other attributes. Can you check with the watch folder to see if there are other attributes that are set?

I seem to remember that PDFG uses a file name attribute and not the content type to determine how to convert native documents.  Since it is not set, that may be causing your problem.

ida_raski
Level 2
Level 2

That can be possible.

  • inDoc from the webservice: has only the Length and Content Type attributes set
  • inDoc from the watched folder has Length, Content Type, basename, file and wsfilename set

So how can I resolve this?

Thanks.

ida_raski
Level 2
Level 2

Yes! I've found the solution.

It was exactly as you told: the CreatePDF activity is based on the filename extension of the file to convert.

I required the original filename with extension to be sent with the webservice.
Afterwards I put this into a variable and gave this to the CreatePDF activity File Extension under Advanced options and everything worked fine!

Thank you for your help!

Regards,

Kristof