0

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!

EmbedThis
  • 21
  • 1
  • 4

3 Answers3

0

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

o-o
  • 8,158
  • 2
  • 20
  • 21
  • You missed the crux of my question. Yes you can set up the submit button to send the xdp or pdf. However, you cannot include other parameters to send to the RESTful web service. That is the problem I am having. – EmbedThis Aug 30 '15 at 03:17
  • Sorry — you need to pass the entire form as a URL parameter?! I can't believe your use-case left you with that sole option, because it sounds a bit desperate. Anyway, I think I've done it in the past, and it should be doable by setting the submit URL through javascript inside a pre-submit event. Unless Adobe closed down that route for security reasons... – o-o Aug 30 '15 at 07:15
  • Well I'm supposed to send the pdf (as xdp or as a pdf string) to the web service AND two other parameters along with it. I would like to know how to do this. So far I have spent a LONG time trying to figure it out and to no avail. – EmbedThis Aug 30 '15 at 18:15
  • Your xdp submission will contain the text fields and the two hidden fields. Sniffing them out on the server side would be a no-brainer, but I'm guessing you either need the extra two vars in the submit url or you don't have access/don't want to change things on the server...? – o-o Aug 30 '15 at 20:48
  • Let me be perfectly clear. I have to send 3 parameters. One of them is an xdp/pdf of the entire file. I have NOT found a way to do this yet. – EmbedThis Aug 30 '15 at 21:47
0

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.

EmbedThis
  • 21
  • 1
  • 4
0

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.

Community
  • 1
  • 1
GuillaumeCleme
  • 317
  • 1
  • 2
  • 10