14.5.1. ProblemYou need to pass data structures more complicated than strings, integers, and other simple types. Instead, you need to pass arrays and objects. 14.5.2. SolutionPass the data as an associative array: $args = array('ticker' => array('EBAY', 'YHOO', 'GOOG')); $client->getQuotes($args); 14.5.3. DiscussionIt can be tricky figuring out how to map PHP data structures into the XML that's described in the WSDL'especially since the premise of SOAP is that general consumers of a SOAP service shouldn't be worrying about the underlying XML . The ext/soap extension does a pretty good job of doing the right thing of properly converting data. However, sometimes you need to get down and dirty and read the WSDL yourself, or see if the service publishes a few SOAP examples that reveal the XML that it's expecting. As a rule of thumb, when you're expected to pass multiple elements of the same name at the same level, such as: <ticker>EBAY</ticker> <ticker>YHOO</ticker> <ticker>GOOG</ticker> You should define an array containing a key of ticker and a value of another array. This array should contain the data that needs to get wrapped around <ticker> tags. 14.5.4. See AlsoRecipe 14.6 for setting SOAP types. |