Processing Web Service Data | Community
Skip to main content
bsaustin98
July 30, 2018
Solved

Processing Web Service Data

  • July 30, 2018
  • 11 replies
  • 4317 views

All,

I'm new to Adobe Forms development and I've run into a roadblock. I'm connecting to a web service I've created to populate data into a form. The form is for internal use only and only using Acrobat Reader with Extensions. I've followed several articles I've found to make progress but I've got one problem I haven't been able to overcome yet.

I connect a drop down list to the web service to populate the list. When an item is selected from that list, I call the web service again to retrieve to more data values and populate two more fields in my form. This all works great and as described. The problem is that these fields are part of a repeating table. When a new line is added to the table and new value is selected from the drop down list on that line, all secondary values in the table change as well. So the drop down list choice on line two not only populates the data lookup values for line two, but it also overwrites the values on line one.

I've found articles that talk about using a postExecute event handler to process the web service data. I've tried using this to manually load the data instead of using the automatic mapping. But I never seem to be able to access the web service response the way the articles indicate I should be able to. I'm hoping someone can point me in the right direction for how to resolve this. Is postExecute the way to fix my issue? if not, what's the best approach?

This is the article I followed to setup the automatic mapping:

http://forms.stefcameron.com/2007/05/21/connecting-to-a-web-service/

This is the best article I've found on the postExecute event:

Populate a listbox from a web service

Thanks!

Barry

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by kjaeggin

it should follow this strucuture near the bottom of the object:

   <event activity="postExecute" ref="$xfa.connectionSet.CityQuery" name="event__postExecute">

    <script contentType="application/x-javascript">

            console.println(xfa.datasets.saveXML("pretty"));  //better to use console.println() as it might be too large a string for a message box.

   </script>

   </event>

</subform>

</subform>

11 replies

Level 7
August 1, 2018

Barry,

I was able to reproduce what you described.  I resolved the problem without any preExecute or postExecute scripts.  Don't include the bound fields in your repeating subform. Instead, leave the bound fields elsewhere in the form and hide them in a hidden subform (exclude from layout).  When you need to invoke the service, programatically copy the input value(s) from your repeating subform fields to the hidden input field(s) that are bound to the web service.  Then programatically invoke the service.  Then copy the values from the bound/hidden output fields to the fields in the repeating subform.  I have an example that illustrates this, but I don't know how to upload it here.

Jared