The Web Service Settings dialog box automatically generates
a SOAP message for invoking the web service. The message is based
on the web service properties that you specified.
You add file attachments that represent document values of service
input parameters to the SOAP message. The following XML code shows
the general structure of a SOAP message that is used to a call a
web service operation:
<soapenv:Envelope
xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/
xmlns:ser="http://foo.net/services">
<soapenv:Header />
<soapenv:Body>
<ser:operation_name>
<ser:parameter_name>
<!-- elements for file attachments are placed here -->
</ser:parameter_name>
</ser:operation_name>
</soapenv:Body>
</soapenv:Envelope>
-
The Body element contains one element that has the same
name as the service operation.
-
The operation_name element contains one element for each
input parameter. The names of these elements are the same as the
parameter names. For the web services of activated processes, the
operation name is always invoke. Parameter names are the names of
the input variables that are defined in the process.
-
The method used to attach files to the SOAP message determines
the elements that are used to identify file attachments. The methods
available are MIME, MTOM, base64-encoded text, or file URLs. (Web
services that AEM forms provides do not support MTOM attachments.)
MIME/MTOM attachment
Use the Attachment tab of the Web Service Settings
dialog box to specify the document value. Each row in the table
represents a file attachment. The Part column contains the identification
of the attachment. The web service determines the identification.
Configure a MIME/MTOM attachment:
-
On the Web Service Settings
dialog box, click the Attachment tab.
-
To add rows to the table, click Load Attachment Part.
-
Note the values in the Part column. You use these values
in step 7.
-
For each row in the table, click the Attachment field. Click
the ellipsis button
that
appears to open XPath Builder.
-
For each row in the table, click the Content-Type cell and
type the MIME type of the file that you are attaching. An example
of a MIME type is
application/pdf
.
-
Click the Request tab, and add an attachmentID element inside
each element that represents the parameter that takes a file attachment
as the value.
-
Inside each attachmentID element, type the text that appears
in the Part column for the attachment on the Attachment tab.
Example
The
following SOAP request is an example of a configuration for a MIME
or MTOM attachment. It is a request message for a process with an
input parameter named documentIn, which is a document value.
<soapenv:Envelope
xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/
xmlns:ser="http://adobe.com/idp/services">
<soapenv:Header/>
<soapenv:Body>
<ser:invoke>
<ser:documentIn>
<ser:attachmentID>
part0
</ser:attachmentID>
</ser:documentIn>
</ser:invoke>
</soapenv:Body>
</soapenv:Envelope>
base64-encoded text attachment
The content MIME type and the base64-encoded
text representation of the file is included in the SOAP message.
The content type is specified in a contentType element. The text
is specified in a binaryData element.
To obtain the base64-encoded
text, you can use the getDocContentBase64 XPath function.
The
following procedure assumes that the base-64 encoded text that represents the
document value is stored in a process variable.
Configure a base64-encoded text attachment:
-
On the Web Service
Settings dialog box, click the Request tab.
-
Add a contentType element to the element that represents
the parameter that specifies the document value.
-
Inside the contentType element, either type the content type
or add an XPath expression that resolves to a string variable that
contains the content type.
-
Add a binaryData element to the element that represents the
parameter that takes the document value.
-
Inside the binaryData element, add an XPath expression that
resolves to a string variable that contains the base64-encoded text
that represents the document.
Example
The
following SOAP request is an example of a configuration for a base64-encoded
text attachment.It is a request message for a process with an input parameter
named documentIn, which is a document value.
<soapenv:Envelope
xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/
xmlns:ser="http://adobe.com/idp/services">
<soapenv:Header/>
<soapenv:Body>
<ser:invoke>
<ser:documentIn>
<ser:contentType>
{$/process_data/@contentType$}
</ser:contentType>
<ser:binaryData>
{$/process_data/@docBase64$}
</ser:binaryData>
</ser:documentIn>
</ser:invoke>
</soapenv:Body>
</soapenv:Envelope>
File URL attachment
The URL of the file is specified in a remoteURL
element.
Configure a file URL attachment:
-
On the Web Service Settings
dialog box, click the Request tab.
-
Inside the element that represents the parameter that takes
the document value, add a remoteURL element.
-
Inside the remoteURL element, either type the URL of the
file or add an XPath expression that resolves to a string variable
that contains the URL.
Example
The
following SOAP request is an example of a configuration for a file
URL attachment. It is a request message for a process with an input
parameter named documentIn, which is a document value.
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ser="http://adobe.com/idp/services">
<soapenv:Header/>
<soapenv:Body>
<ser:invoke>
<ser:documentIn>
<ser:remoteURL>
http://help.adobe.com/en_US/AEM forms/es/overview.pdf
</ser:remoteURL>
</ser:documentIn>
</ser:invoke>
</soapenv:Body>
</soapenv:Envelope>