You can invoke a LiveCycle service using Java proxy
classes and BLOB data over HTTP. To invoke the MyApplication/EncryptDocument service using
Java proxy classes, perform the following steps:
Create Java proxy classes using JAX-WS that consumes
the MyApplication/EncryptDocument service WSDL.
Use the following WSDL endpoint:
http://hiro-xp:8080/soap/services/MyApplication/EncryptDocument?WSDL&lc_version=9.0.1
For
information, see Creating Java proxy classes using JAX-WS.
Note: Replace hiro-xp with the IP address of the J2EE application server hosting LiveCycle.
Package the Java proxy classes created using using JAX-WS
into a JAR file.
Include the Java proxy JAR file and the JAR files located
in the following path:
<Install Directory>\Adobe\Adobe LiveCycle ES4\sdk\client-libs\thirdparty
into your Java client project’s class
path.
Create a MyApplicationEncryptDocumentService object
by using its constructor.
Create a MyApplicationEncryptDocument object
by invoking the MyApplicationEncryptDocumentService object’s getEncryptDocument method.
Set the connection values required to invoke LiveCycle by assigning values to the following data members:
Assign the WSDL endpoint and the encoding type to the javax.xml.ws.BindingProvider object’s ENDPOINT_ADDRESS_PROPERTY field.
To invoke the MyApplication/EncryptDocument service
using BLOB over HTTP encoding, specify the following URL value:
http://hiro-xp:8080/soap/services/MyApplication/EncryptDocument?blob=http
Assign the LiveCycle user to the javax.xml.ws.BindingProvider object’s USERNAME_PROPERTY field.
Assign the corresponding password value to the javax.xml.ws.BindingProvider object’s PASSWORD_PROPERTY field.
The
following code example shows this application logic:
//Set connection values required to invoke LiveCycle
String url = "http://hiro-xp:8080/soap/services/MyApplication/EncryptDocument?blob=http";
String username = "administrator";
String password = "password";
((BindingProvider) encryptDocClient).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, url);
((BindingProvider) encryptDocClient).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, username);
((BindingProvider) encryptDocClient).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, password);
Create a BLOB object by using its constructor.
Populate the BLOB object by invoking its setRemoteURL method.
Pass a string value that specifies the URI location of a PDF document
to pass to the MyApplication/EncryptDocument service.
Invoke the MyApplication/EncryptDocument process
by invoking the MyApplicationEncryptDocument object’s invoke method
and passing the BLOB object that contains the PDF
document. This process returns an encrypted PDF document within
a BLOB object.
Create a byte array to store the data stream that represents
the encrypted PDF document. Invoke the BLOB object’s getRemoteURL method
(use the BLOB object returned by the invoke method).
Create a java.io.File object by using its
constructor. This object represents the encrypted PDF document.
Create a java.io.FileOutputStream object
by using its constructor and passing the java.io.File object.
Invoke the java.io.FileOutputStream object’s write method.
Pass the byte array that contains the data stream that represents
the encrypted PDF document.