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

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

Expand Messages
  • Byrne Reese
    Oct 19 10:46 PM
      This is easily accomplished using SOAP::Lite 0.65 Beta 1 - currently available for download.

      The code below demonstrates how to use SOAP::Serializer's new register_ns() method, which adds a new global namespace. This makes it easier to construct complex types, as well as provide a slew of namespaces that may or may not by used.
      my $soap = SOAP::Lite
         ->uri($uri)
         ->readable(1)
         ->proxy($proxyUrl);

      $soap->serializer->register_ns("urn:Foo",'foo');
      $soap->serializer->register_ns("urn:Bar",'bar');

      print $soap->c2f(SOAP::Data->name('temperature' => 100));
      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
      way:

      ${${$method}{_attr}}{'maxRows'} = '99';

      But, this seems like a bad way to access an object's data.

      Thanks,
      Mark



    • Show all 4 messages in this topic