proph3t
proph3t

Reputation: 965

Filling Dropdowns From Web-Service SOAP Response

Using PHP, I am working to create a series of dropdown menus that work in a sequential order while populating via numerous web-service calls.

For example, a user will select a year from dropdown #1. With that year, I then make a SOAP call (using only the given year) to gather makes and populate dropdown #2. This will then make another SOAP call (using the given year and make) to gather models. This will then make another SOAP call (using the given year, make, and model) to gather an id. A final SOAP call will then be made using the given ID to get the desired data.

My question, how can I go about accomplishing this with so many calls and "holding" all the needed values throughout the process?

Upvotes: 2

Views: 242

Answers (1)

Kris Peeling
Kris Peeling

Reputation: 1025

You have a lot of options on how to architect this page, but I would recommend using using AJAX requests with Javascript. On the first drop-down selection, an AJAX request is triggered, which calls a PHP script, SOAP call is completed, response converted to JSON, which is used to populate the next drop-down. Rinse and repeat for subsequent drop-downs.

Using this method you can take advantage of caching the SOAP results, so common responses are re-used, and your app is fast.

Use the popular jQuery library to accomplish your AJAX requests and drop-down population.

Upvotes: 1

Related Questions