Dynamic data dropdown with Web Service not working

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Dynamic data dropdown with Web Service not working

adoa-aset-ak
I am trying to populate a dropdown with values from a Web Service. When I load the form the dropdown shows up empty.

I need to access a REST service using an IP address and Port number. Using tcpdump (linux) I found out that the server doesn't even call the webservice when using ip/port number url. Can the Dynamic DD work with url's that have port numbers?

To test whether its a port number issue I tried http://www.loc.gov/standards/codelists/countries.xml. I used tcpdump to verify that the server is indeed calling the website and getting the results back but the dropdown is still empty. I have attached the source code. DynamicDD.xml
Reply | Threaded
Open this post in threaded view
|

Re: Dynamic data dropdown with Web Service not working

adoa-aset-ak
I was able to fix this issue. Turns out my Web Service adds a namespace declaration to the xml that gets returned.

Steps to solve the issue:
1) Examine the xml that is being generated by the Web Service. You can do this by trying the Test button on HTTP Services>Add screen.

2) Declare a namespace prefix (xmlns:r="http://www.test.com/TEST_DATA_SERVICE") in the Form source code. You can do this by going to Advanced>Edit Source.

3) Change the XPath expressions of the Dynamic Data Dropdown:
Items = //r:role (instead of //role)
Label = r:roleName (instead of roleName)
Value = r:roleName (instead of roleName)

Hope that helps others having issues with Dynamic Data Dropdown.