How do you want to post the XML - directly from HTML, HTML through a servlet, a .Net client?
Direct from html will be fine. I don't need the html example code, just how to configure within workbench. I would like to POST two variables in the request. First variable is the xmlData, second variable is which template (xdp) to marry with the data to generate the pdf. The response to the request should contain the PDF file if possible.
I built a process called GetPDF that has three process variables:
1) formName - input variable of type 'string'
2) xmlDataStr - input variable of type 'string' (rather than mess with xml I just deserialize the string to xml, below)
3) pdfDoc - output variable of type 'document'
The process contains two services:
1) 'Get Form' is a Foundation Repository Service, Read Resource Content operation
Input Resource Uri - XPath expression concat("/Applications/REST-Endpoint-Sample/1.0/forms/",/process_data/@formName)Output result - variable 'pdfDoc'
Your process may use a different technique to get the form into the process.
2) 'Render PDF Form' is a Forms FormServuce, renderPDFForm operation
Input Form - variable 'pdfDoc'
Input Form Data - XPath expression deserialize(/process_data/@xmlDataStr)
Output Rendered Form - variable 'pdfDoc'
Once you save, check-in, and deploy the service, go to the Administration UI > Services > Application and Services > Service Management and find the application and process. Take a look at the REST endpoint and you will see the invocation URL. In my case the URL is
Based upon the invocation URL and my process variable names, I can go to a browser and enter
http://localhost:8080/rest/services/REST-Endpoint-Sample/processes/GetPDF?formName=SimpleF orm.pdf&xmlDataStr=<?xml version="1.0" encoding="UTF-8"?><customer><firstName>Steve</firstName><lastName>Walker</lastName><stree t>345 Park Ave.</street><city>Sacramento</city><state>CA</state><zip>95829</zip></customer>
When you break down the http request you see the references to the two input variables
2) xmlDataStr=<?xml version="1.0" encoding="UTF-8"?><customer><firstName>Steve</firstName><lastName>Walker</lastName><stree t>345 Park Ave.</street><city>Sacramento</city><state>CA</state><zip>95829</zip></customer>
The call will result in a merged PDF document. You will notice the response URL looks something like this...
which is a reference to in-memory document object.
This works great. I tweaked the second service a bit to use an Output - generatePDF Output service instead since that's the LC module that we are licensing. Thanks!
Please, explain little bit more how to create first service in ES3 Workbench.
I can't find Foundation Repository Service...