Samples and examples in this document are only for AEM Forms on JEE environment.
Validate a DDX document by using the Assembler Service API (web service):
Include project files.
Create a Microsoft .NET project that uses MTOM. Ensure that you use the following WSDL definition:
Replace localhost with the IP address of the forms server.
Create a PDF Assembler client.
AssemblerServiceClient object by using its default constructor.
AssemblerServiceClient.Endpoint.Address object by using the
System.ServiceModel.EndpointAddress constructor. Pass a string value that specifies the WSDL to the AEM Forms service (for example,
http://localhost:8080/soap/services/AssemblerService?blob=mtom). You do not need to use the
lc_version attribute. This attribute is used when you create a service reference.
System.ServiceModel.BasicHttpBinding object by getting the value of the
AssemblerServiceClient.Endpoint.Binding field. Cast the return value to
MessageEncoding field to
WSMessageEncoding.Mtom. This value ensures that MTOM is used.
Enable basic HTTP authentication by performing the following tasks:
HttpClientCredentialType.Basicto the field
BasicHttpSecurityMode.TransportCredentialOnlyto the field
Reference an existing DDX document.
BLOBobject by using its constructor. The
BLOBobject is used to store the DDX document.
System.IO.FileStreamobject by invoking its constructor and passing a string value that represents the file location of the DDX document and the mode to open the file in.
System.IO.FileStreamobject. You can determine the size of the byte array by getting the
Readmethod and passing the byte array, the starting position, and the stream length to read.
BLOBobject by assigning its
MTOMproperty with the contents of the byte array.
Set run-time options to validate the DDX document.
AssemblerOptionSpecobject that stores run-time options by using its constructor.
logLeveldata member. method When validating a DDX document, you want more information written to the log file that will assist in the validation process. As a result, you can specify the value
FINER. For information about the run-time options that you can set, see the
AssemblerOptionSpecclass reference in AEM Forms API Reference.
Perform the validation.
invokeDDX method and pass the following values:
BLOBobject that represents the DDX document.
Mapobject that usually stores PDF documents.
AssemblerOptionSpecobject that specifies run-time options.
invokeDDX method returns an
AssemblerResult object that contains information that specifies whether the DDX document is valid.
Save the validation results in a log file.
System.IO.FileStreamobject by invoking its constructor and passing a string value that represents the file location of the log file and the mode to open the file in. Ensure that the file name extension is .xml.
BLOBobject that stores log information by getting the value of the
BLOBobject. Populate the byte array by getting the value of the
System.IO.BinaryWriterobject by invoking its constructor and passing the
Writemethod and passing the byte array.
If the DDX document is invalid, an
OperationException is thrown. Within the catch statement, you can get the value of the