Loading ...
Sorry, an error occurred while loading the content.

3492Re: [soaplite] Cumulative SOAP::Data->attr access?

Expand Messages
  • Duncan Cameron
    Apr 8, 2004
      At 17:30:56 on 08-04-2004 amigo_boy2000 <amigo_boy2000@...> wrote:

      >I am trying to do add optional attributes if the user invoking my
      >script specified their values. For example:
      >$method = SOAP::Data->name('find_business')
      > ->attr({xmlns => 'urn:something', generic => '2.0'});
      >if (defined($maxRows)) {
      > $method->attr({maxRows => $maxRows});
      >This seems to destroy the attributes set on the first call. Is there
      >any way to cumulatively add (build) optional attributes if the values
      >were passed to my script? The only way I know how to do it is this
      >${${$method}{_attr}}{'maxRows'} = '99';
      >But, this seems like a bad way to access an object's data.
      It is slightly clumsy but this should do what you want

      $method->attr({%{$method->attr}, maxRows => $maxRows});

    • Show all 4 messages in this topic