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

1914Re: [soaplite] Question on 'Cannot encode... as hash, encode as map instead'

Expand Messages
  • Paul Kulchenko
    Oct 14, 2002
    • 0 Attachment
      Hi Ron,

      > My question is, what would be equivalent code I can write, in order
      > to
      > **encode these as map values in the first place?** I'd rather
      Pseudo-type 'map' can be used:

      SOAP::Data->type(map => {"" => foo});

      you shouldn't have varning in this case.

      Best wishes, Paul.

      --- Ron Murphy <rmurphy@...> wrote:
      > Hi,
      >
      > I have some code similar to
      >
      > sub foo
      > {
      > my $class = shift;
      > my %hash;
      > $hash{""} = "emptyval";
      > $hash{"bbb"}{""} = "emptybbbval";
      > }
      >
      > This prints warnings like,
      >
      > Cannot encode unnamed element as 'hash'. Will be encoded as 'map'
      > instead
      > Cannot encode 'value' element as 'hash'. Will be encoded as 'map'
      > instead
      >
      > I see that values such as empty string do not conform to what XML
      > wants as
      > names, so that's fine. The receiving SOAP::Lite client also grabs
      > these
      > mutated values just fine as hashes.
      >
      > My question is, what would be equivalent code I can write, in order
      > to
      > **encode these as map values in the first place?** I'd rather
      > write code
      > that does not produce warnings (I don't want to disable warnings
      > like
      > these).
      >
      > If there is any documentation explaining this already, kindly point
      > me to
      > it.
      >
      > Thanks
      > Ron
      >


      __________________________________________________
      Do you Yahoo!?
      Faith Hill - Exclusive Performances, Videos & More
      http://faith.yahoo.com
    • Show all 2 messages in this topic