Invoke LiveCycle with Visual Basic .NET 2005/2008
LiveCycle services can be invoked via SOAP from a Windows dektop application built with Visual Basic .NET
The basic steps are (for both Visual Studio 2005 and 2008):
1) Create a "Windows Application"
2) Create a "Web Reference" and point it to the WSDL file of the LiveCycle service you are interested in. The Forms service WSDL is at http://ip_address:web_container_port/soap/services/FormsService?wsdl. Examples are:
- JBoss : http://jboss_server:8080/soap/services/FormsService?wsdl
- WebSphere : http://was_server:9080/soap/services/FormsService?wsdl
- WebLogic : http://wl_server:7002/soap/services/FormsService?wsdl
3) Use this web reference to start coding
Sample code (Visual Studio solution) invoking the RenderPDFForm and ProcessFormSubmission methods of the Forms service is attached. It contains one form with two buttons.
The click event on the first button:
- reads an XML data file from a Windows desktop client's local disk
- calls Adobe LiveCycle ES Forms using SOAP over HTTP to render an XDP form template on the server filesystem with this XML data
- retrieves the rendered interactive PDF form
- invokes Microsoft Internet Explorer and displays it
The click event on the second button:
- reads a saved interactive PDF form file from a Windows desktop client's local disk
- calls the ProcessFormSubmission method of Adobe LiveCycle ES Forms using SOAP over HTTP with the PDF file
- retrieves the extracted XML data
- invokes Microsoft Internet Explorer and displays it
The code has been tested on Windows Vista clients against:
- LiveCycle ES running on IBM WebSphere ND 6.1.0.9 on AIX 5.3/Oracle 10g
- LiveCycle ES running on JBoss 4.0.3SP1/Windows 2003 Server/SQL Server 2005
To make it work in your environment, you would need to change the values of the constants at the beginning and re-build the solution. The input document for the ProcessFormSubmission is actually the output PDF of the RenderPDFForm, saved to the local disk.
The solution was built using Visual Studio 2005. If you open it in Visual Studio 2008, an import will be required. However, the code has been tested to work in Visual Studio 2008.
Comments
If you are using Visual Studio.NET 2005 or higher (2008 as well), you should look to make a service reference as well, using Windows Communications Foundation to access the web service, in the event you need finer-grained control over the process.
Posted by: Nicholas Paldino | January 4, 2008 03:14 PM