From: Paul K. <pau...@ya...> - 2004-04-18 06:31:06
|
Mark, > if (defined($findQualifier)) { > $find_binding[$#find_binding + 1] = > findQualifiers( > findQualifier(@{$findQualifier}) > ); > } can also be written as: push @params, findQualifiers(findQualifier(@$findQUalifier)) if ref $findQualifier; > $find_binding[$#find_binding + 1] = > tModelBag( > tModelKey(@{$tModelKeys}) > ); push @params, tModelBag(tModelKey(@$tModelKeys)) if ref $tModelKeys; > 2. How can I dynamically add attributes to find_binding? For Just create a hash with those parameters and set only ones you need: $attrs{maxRows} = 5; # and later: $bindingDetail = find_binding($attrs, @parameters); Hope that works for you. Paul. --- Mark Fuller <mar...@ea...> wrote: > 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 > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO > of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Soaplite-devel mailing list > Soa...@li... > https://lists.sourceforge.net/lists/listinfo/soaplite-devel |