Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Showing XML Data Retrieved via Web Service within a Form

Avatar

Former Community Member

Hello

I have a use case I'm working on wherein I do the following:

- Wire up a WSDL within my PDF

- Bind the response (which is some XML) to a hidden text field

- Throw a button on the PDF that, when clicked, invokes that web service operation

- Take the XML response and display it in a table within the PDF

- Create a TaskManager endpoint so the user can access the form through Workspace

The user would then go into the form via Workspace and would invoke the web service which returns a bunch of data as XML - which I want to display to them in a readable fashion.

At first I thought there should be a "clean" way to just wire up a table object to XML using some form of dynamic binding but I see that's not available with tables.  Then I thought I could just use the loadXML() method to load the XML response from the web service at the appropriate point of the data DOM but it doesn't seem to be working either.

How, then, can I display this XML data in a readable format to my user WITHOUT hacking up some Javascript to manually parse it and stuff it into fields?  Isn't there a relatively "clean" way to do this?

2 Replies

Avatar

Level 10

Can you share a small portion of the XML being returned by the web service? I will try out a sampe in my sandbox.

I hope there must be a cleaner way to display them in tables.

Nith

Avatar

Former Community Member

The XML is actually coming from a Query Multiple Rows as XML service call within an orchestration and therefore takes the following form:

<RootNode>

     <EntryNode>

          <ColumnA>Some Value A</ColumnA>

          <ColumnB>Some Value B</ColumnB>

     </EntryNode>

     <EntryNode>

          <ColumnA>Some Value C</ColumnA>

          <ColumnB>Some Value D</ColumnB>

     </EntryNode>

</RootNode>

I played around with a bit and didn't see a good way to address it.  I've since just written up some Javascript to parse it and stuff the table but if you find a good way to bind it up straight in, perhaps by loading the XML into the data DOM, let me know!

Thanks!