Archive for August, 2008
Using Documents with JDBC Service
Steps in this example:
- Using the JDBC Service Execute, create a table to test with using CREATE TABLE doc_test(doc LONGBLOB). This will create a table called doc_test with the single column called doc.
- Using the JDBC Execute, use a parameterized query to set the document from process data into the SQL statement, ie – INSERT INTO doc_test(doc) VALUES (?). You need to check the Use Parameterized query, select the type BLOB and select the process data for your document:

- Using the JDBC Query Single, select the document from the database and map its value to a process data variable. SQL Statement: SELECT doc from doc_test. Click on the Data Mapping and select Parse Query. This should enter the defaults for your Select Statement. You will then need to map to the process variable for your document:

- Link to Attachments for process file and lca Using-documents-with-jdbc
WebService calls using base64 Documents
For this sample we will create 2 processes to demonstrate how to call a webservice passing a Document to/from the webservice. The process xml file is also attached to the page and can be imported into workbench.
Create a process to be used as a webservice:
- In workbench, create a new short lived process called echoDoc. This process will need 1 input variable of type Document and one output variable of type Document. This example uses the names inDoc for the input Document and outDoc for the output Document.
- Drag in the Set Value service. This will be the only Step needed in your process.
- Double click on the Set Value service in your process, and select the ‘+’ for a new mapping. You will need to map the location of the output document to the input document. Set the location: /process_data/@outDoc to the Expression /process_data/@inDoc. This simply “echos” the document passed in.
- Save and activate the process. You should now be able to see the WSDL at http://localhost:8080/soap/services/echoDoc?wsdl if on a JBoss server, or change the port if another app server is used.
Create the process to call a webservice passing documents base 64 encoded
- Create a short lived process called for the webservice call with the following variables:

- As the first step in the process, drag in the Set Value Service and set the following mappings, Set the Content type variable (/process_data/@contentType) to the input document content type using the document function getDocContentType (getDocContentType(/process_data/@inDoc)). Set the base 64 variable (/process_data/@docBase64) using the getDocContentBase64 function to get the contents of the input document in base64 (getDocContentBase64(/process_data/@inDoc)):

- Next, Drag in the service WebService and click on the Options in the Web Service Options pane. You will need to load the WSDL URL for the service create above (http://localhost:8080/soap/services/echoDoc?wsdl) and chose load wsdl. You may also have to set the user name and password to invoke the service, by default the ES WSDLs are secure. You also need to append ?blob=base64 to the target URL to tell ES to return the document in base64:

- Next, Click on the request tab, select Include optional and Genereate the SOAP Request. This will generate the SOAP Request with all the available parameters. We will need to only fill in the values for contentType, binaryData and remove the extra Optional elements. Set the contentType element to {$/process_data/@contentType$} and the binaryData to {$/process_data/@docBase64$}. Note that the attachmentID and remoteURL elements are optional and removed:

- Last we will need to drag in another Set Value service to pull out the Base64 encoded document from the Soap Response and set the content type of the new document. We need to set the outDoc variable using the getDocFromBase64 function passing in the binaryData element from the Soap response:

- Last, we should activate and invoke the process.
There is also a technote kb403973 on attachments at http://kb.adobe.com/selfservice/viewContent.do?externalId=kb403973&sliceId=1
Document with attachments with application Webservice-calls-using-base64