From: Mark F. <mar...@ea...> - 2004-04-18 05:01:54
|
Hi Paul, A quick question. I hope this isn't something that belongs on the user list. It's part of my attempt to contribute a v2 sample which calls each service and processes the entire result of each. I have the latter half complete and am working on making the "calls" a better example. I want to dynamically build the parms (or content model?) to a UDDI method based upon whether optional elements (and attributes) are present. The sample/syntax1 script gave me ideas. Using "find_binding" as an example, I came up with this: ======= start ======= #---------------------- # If findQualifier values were specified, create the UDDI::Lite structure # and add it to the array of objects to be passed to find_binding. #------------------------------- if (defined($findQualifier)) { $find_binding[$#find_binding + 1] = findQualifiers( findQualifier(@{$findQualifier}) ); } #---------------------- # tModelBag is always required. Build the structure and add # it to the array of objects to be passed to find_binding. #---------------------- $find_binding[$#find_binding + 1] = tModelBag( tModelKey(@{$tModelKeys}) ); $bindingDetail = find_binding({serviceKey => $serviceKey, maxRows => $maxRows}, @find_binding); ======= end ======= Two questions: 1. The above works. Is there a better way to accumulate optional and required elements and attributes based upon dynamic input to a script (example, from a web page)? 2. How can I dynamically add attributes to find_binding? For example, let's say serviceKey and maxRows are both optional. How can I include them depending upon their presence? I can't do "find_binding->attr->maxRows{maxRows} = $maxRows". It causes find_binding to be executed as a method. Thanks! Mark |