Expand my Community achievements bar.

NullPointerException converting Native to PDF

Avatar

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

Avatar

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)?

Avatar

Level 2

I'm using soapUI to send the request.

The binaryData refers to the attached word document.

Avatar

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

Avatar

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

Avatar

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.

Avatar

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.

Avatar

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