Adobe LiveCycle Web Services Invocation

264 Views Asked by At

I have a simple form with a button (submit), two textbox fields and two hidden fields. On submit, I would like to pass in 3 parameters to a service using a WSDL URL. More specifically, I would like to pass in the ENTIRE form (including data entered in form) as a string (in xdp or pdf format) as one parameter and the values of the two hidden fields as two other separate parameters.

I am using Javascript to call the web service and pass in the parameters.

I have been struggling with trying to pass in the ENTIRE form as an xdp or pdf as a string parameter to call the web service. Is this even possible?

Thank you!

3

There are 3 best solutions below

5
On

Yes. You can set that up inside the submit button settings, either sending form data as plain xml or xdp.

0
On

Well I couldn't figure out how to get the entire xdp. HOWEVER...

As it turns out I found out how to get the entire pdf.

You MUST get the base64 encoding in order to get the entire pdf. For some reason if you do not encode the Collab.documentToStream into base64 it doesn't return the entire pdf (only a small section of it). This is my solution:

var documentString = util.stringFromStream(SOAP.streamEncode(Collab.documentToStream(event.target), "base64"));

From that you can decode the string from base64 to ansi on the server side which should give you the entire pdf to be stored or opened.

I will accept this as an answer to my own question. I edited my original question for clarification.

0
On

It is bad practice to pass this in the URL. If you want to use a String, it should be passed in the body of the request (i.e. a REST endpoint that accepts a string input). Passing this in the URL could eventually reach the URL length limit if the form or data is long enough.