Processing XML Data with Arbitrary Namespaces and Prefixes within a SOAP Envelope

compared with
Current by David Glen
on Oct 18, 2007 18:39.

Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (24)

View page history
Please click [here|XML Utilities DSC] for full reference on XML Utilities DSC.
 
h2. Using the Avoka XML Utilities DSC
h3. Scenario
In integrating an external system into LiveCycle ES, one of the possible ways of integration is via a web service call using the Standard Web Service DSC. A web service invocation returns a response message from invoking a web service as XML data wrapped in a SOAP envelope, which will normally be assigned to a process variable of type XML. Usually, the XML variable has the schema defined to enable easier browsing to locate a particular element within the XML.

However, by having the XML response message wrapped in a SOAP envelope, it makes it difficult for the Xpath Expression Builder dialog to browse through the XML variable. Besides, it often has namespace information, stopping the XML variable being processed normally unless the namespace and its prefix are registered via process properties.
h3. The XML Utilities Service
This is developed by Avoka Technologies, containing a number of useful XML Utilities operations to manipulate XML data, from which two of them will be discussed in the following example to cover the scenario discussed scenario shown above. !operations.jpg|align=center!\\
\\
\\
\\ *1. Extract SOAP Body*
    This operation extracts SOAP Body from a SOAP message.
\\
*2. Remove Namespaces*
    This operation removes namespaces and their prefixes from XML.
*1. Extract SOAP Body*
This operation extracts SOAP Body from a SOAP message.
\\
*2. Remove Namespaces*
This operation removes namespaces and their prefixes from XML.
\\ \\

To obtain an evaluation copy of the XML Utilities Service, go to the Avoka Website: [http://www.avoka.com] and follow the links.
\\
\\
\\
\\ \\

h3. The Process
\\ !process.jpg|align=center!\\
\\
\\
\\
\\
As shown in the figure above, there are three initial steps. First we invoke a web service call to an external system and store the SOAP response message into an XML variable. The second step is to extract SOAP body out of its envelope, and the third step is to remove any namespaces and their prefixes from the XML. Once this is done, we can treat the XML variable as we treat other XML variables. For example, in the process above, we refer to an element inside the XML variable and make process decision based on its value, whether to perform activity A or activity B.
\\
\\ \\
 
For demonstration purpose, we have provided the exported [process XML file|^TestProcess.1.1.xml]for the process described above as an attachment to this article. You can import it as a process to your LiveCycle ES via workbench for guidance in setting up property values for those XML Utilities operation steps.
\\

h3. Setting Properties for Extract SOAP Body Operation
\\ !extractSoapBodyProperty.jpg|align=center!
 
To configure the properties of the Extract SOAP Body operation step, click on that step, and click on the "Properties" view on your Workbench. It will show a dialog box as shown above.
All you need to do is to specify the XML variable which contains the SOAP message, which message that you would like to extract the SOAP body from, and assign a process variable to store the SOAP body content. In this example, I store it example, it was stored back to the same XML variable (response).
\\
\\
\\
\\
\\
\\ \\

h3. Setting Properties for Remove Namespaces Operation
\\ !removeNamespaceProperty.jpg|align=center!\\
To configure the properties of the Remove Namespaces operation step, click on that step, and click on the "Properties" view on your Workbench. It will show a dialog box as shown above.
Almost the same as previous operation was explained, all you need to do is to specify the XML variable as the source, which source that you would like to remove all its namespaces and prefixes, and specify a process variable to store the result XML. Again, in this example, we store it example, it is stored back to the same process variable (response).
\\
\\
\\
\\
\\
\\ \\