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

1860Re: [soaplite] Header element

Expand Messages
  • Randy J. Ray
    Sep 20, 2002
    • 0 Attachment
      On 2002.09.20 06:33 john_griffin12 wrote:
      > Anyone know how to get this in the header
      >
      > <element a=xxx b=xxx c=xxx></element>
      >
      > I tried:
      > $header = SOAP::Header->new(name => 'element')
      > ->attr(a => 'xxx',
      > b => 'xxx',
      > c => 'xxx');
      >
      > but it doesn't work. Data dumper shows this:
      >
      > $VAR1 = bless( {
      > '_value' => [
      > 'xxx',
      > 'b',
      > 'xxx',
      > 'c',
      > 'xxx'
      > ],
      > '_signature' => [],
      > '_name' => 'element',
      > '_attr' => 'a'
      > }, 'SOAP::Header' );

      The attr() method takes a hash reference, not a hash. If I've used a hash/list
      in previous responses, I apologize for any confusion. What happened was it
      took the "a" as the value for attr, and the rest of the list as the overall
      value for the element (see the manual page section on SOAP::Data for the
      semantics of the methods).

      Instead, do this:

      $header = SOAP::Header->new(name => 'element')
      ->attr({ a => 'xxx',
      b => 'xxx',
      c => 'xxx' });

      Randy
      --
      rjray@... Linux: Because rebooting is for adding new hardware.

      Any spammers auto-extracting addresses from this message will definitely want
      to include uce@... and report@...
    • Show all 2 messages in this topic