You can programmatically add a Remoting endpoint to a service
by using the LiveCycle Java API. By adding a Remoting endpoint,
you are enabling a Flex application to invoke the service by using
remoting. (See Invoking LiveCycle using Remoting.)
For the purposes of programmatically adding a Remoting endpoint
to a service, consider the following short-lived process named EncryptDocument.
This process accepts an unsecured PDF document as an input value
and then passes the unsecured PDF document to the Encryption service’s EncryptPDFUsingPassword operation.
The PDF document is encrypted with a password, and the password-encrypted
PDF document is the output value of this process. The name of the
input value (the unsecured PDF document) is InDoc and
the data type is com.adobe.idp.Document. The name
of the output value (the password-encrypted PDF document) is SecuredDoc and
the data type is com.adobe.idp.Document.
To demonstrate how to add a Remoting endpoint to a service, this
section adds a Remoting endpoint to a service named EncryptDocument.
注意: You cannot add a Remoting endpoint by using
web services.
Summary of stepsTo remove an endpoint from a service, perform the following
tasks:
Include project files.
Create an EndpointRegistryClient object.
Set Remoting endpoint attributes.
Create a Remoting endpoint.
Enable the endpoint.
Include project filesInclude the necessary files in your development
project. If you are creating a client application by using Java,
include the necessary JAR files. If you are using web services,
make sure that you include the proxy files.
The following
JAR files must be added to your project’s class path:
adobe-livecycle-client.jar
adobe-usermanager-client.jar
adobe-utilities.jar (required if LiveCycle is deployed
on JBoss Application Server)
jbossall-client.jar (required if LiveCycle is deployed
on JBoss Application Server)
For information about
the location of these JAR files, see Including LiveCycle Java library files.
Create an EndpointRegistry Client objectTo programmatically
add a Remoting endpoint, you must create an EndpointRegistryClient object.
Set Remoting endpoint attributesTo create a Remoting endpoint
for a service, specify the following values:
Connector identifier value:
Specifies the type of endpoint that is created. To create a Remoting
endpoint, specify Remoting.
Description: Specifies the description of the endpoint.
Name: Specifies the name of the endpoint.
Service identifier value: Specifies the service to
which the endpoint belongs. For example, to add a Remoting endpoint
to the process that is introduced in this section (a process becomes
a service when it is activated within Workbench), specify EncryptDocument.
Operation name: Specifies the name of the operation
that is invoked by using the endpoint. When creating a Remoting
endpoint, specify a wildcard character (*).
Create a Remoting endpointAfter you set Remoting endpoint attributes,
you can create a Remoting endpoint for a service.
Enable the endpointAfter you create a new endpoint, you must
enable it. When a Remoting endpoint is enabled, it enables a Flex
client to invoke the service.
Add a Remoting endpoint using the Java APIAdd a Remoting endpoint by using the Java API:
Include project files.
Include client JAR files,
such as adobe-livecycle-client.jar, in your Java project’s class
path.
Create an EndpointRegistry Client object.
Set Remoting endpoint attributes.
Create a CreateEndpointInfo object
by using its constructor.
Specify the connector identifier value by invoking the CreateEndpointInfo object’s setConnectorId method
and passing the string value Remoting.
Specify the description of the endpoint by invoking the CreateEndpointInfo object’s setDescription method
and passing a string value that describes the endpoint.
Specify the name of the endpoint by invoking the CreateEndpointInfo object’s setName method
and passing a string value that specifies the name.
Specify the service to which the endpoint belongs by invoking
the CreateEndpointInfo object’s setServiceId method
and passing a string value that specifies the service name.
Specify the operation that is invoked by the CreateEndpointInfo object’s setOperationName method
and passing a string value that specifies the operation name. For
a Remoting endpoint, specify a wildcard character (*).
Create a Remoting endpoint.
Create the endpoint by
invoking the EndpointRegistryClient object’s createEndpoint method
and passing the CreateEndpointInfo object. This
method returns an Endpoint object that represents
the new Remoting endpoint.
Enable the endpoint.
Enable the endpoint by invoking
the EndpointRegistryClient object’s enable method
and passing the Endpoint object that was returned
by the createEndpoint method.
|
|
|