You can invoke LiveCycle services by using the
web service standard MTOM. This standard defines how binary data,
such as a PDF document, is transmitted over the Internet or intranet.
A feature of MTOM is the use of the XOP:Include element.
This element is defined in the XML Binary Optimized Packaging (XOP)
specification to reference the binary attachments of a SOAP message.
The discussion here is about using MTOM to invoke the following
LiveCycle short-lived process named MyApplication/EncryptDocument.
Note: This process is not based on an existing LiveCycle process. To follow along with the code example, create
a process named
MyApplication/EncryptDocument using
Workbench. (See
Using Workbench.)
When this process is invoked, it performs the following actions:
Obtains the unsecured PDF document that is passed to
the process. This action is based on the SetValue operation.
The input parameter for this process is a document process
variable named inDoc.
Encrypts the PDF document with a password. This action is
based on the PasswordEncryptPDF operation. The
password encrypted PDF document is returned in a process variable
named outDoc.
Note: MTOM support was added in LiveCycle,
version 9.
Important: JAX WS-based applications that use the
MTOM transmission protocol are limited to 25MB of sent and received
data. This limitation is due to a bug in JAX-WS. If the combined
size of your sent and received files exceeds 25MB, use the the SwaRef
transmission protocol instead of the MTOM one. Otherwise, there
is a possibility of an OutOfMemory exception.
The discussion here is about using MTOM withthin a Microsoft
.NET project to invoke LiveCycle services. The .NET framework
used is 3.5, and the development environment is Visual Studio 2008.
If you have Web Service Enhancements (WSE) installed on your development
computer, remove it. The .NET 3.5 framework supports a SOAP framework
named Windows Communication Foundation (WCF). When invoking LiveCycle by using MTOM, only WCF (not WSE) is supported.
Creating a .NET project that invokes a service using MTOM
You can create a Microsoft .NET project that can invoke
a LiveCycle service using web services. First, create a
Microsoft .NET project by using Visual Studio 2008. To invoke a
LiveCycle service, create a Service Reference to the LiveCycle service that you want to invoke within your project. When
you create a Service Reference, specify a URL to the LiveCycle service:
http://localhost:8080/soap/services/MyApplication/EncryptDocument?WSDL&lc_version=9.0.1
Replace localhost with the IP address of the
J2EE application server hosting LiveCycle. Replace MyApplication/EncryptDocument with
the name of the LiveCycle service to invoke. For example,
to invoke a Rights Management operation, specify:
http://localhost:8080/soap/services/RightsManagementService?WSDL&lc_version=9.0.1
The lc_version option ensures that LiveCycle functionality, such as MTOM, is available. Without specifying
the lc_version option, you cannot invoke LiveCycle using MTOM.
After you create a Service Reference, data types associated with
the LiveCycle service are available for use within your
.NET project. To create a .NET project that invokes a LiveCycle
service, perform the following steps:
Create a .NET project using Microsoft Visual Studio 2008.
In the Project menu, select Add Service Reference.
In the Address dialog box, specify the WSDL to the
LiveCycle service. For example,
http://localhost:8080/soap/services/MyApplication/EncryptDocument?WSDL&lc_version=9.0.1
Click Go and then click OK.