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

Re: [soaplite] How can I get rid of a "Cannot encode 'item' element as 'hash'"warning

Expand Messages
  • Duncan Cameron
    ... The warning is probably caused by one of your hash keys having a character that is not valid in an XML element name. Possibly a space character but it
    Message 1 of 2 , Jun 10, 2004
    • 0 Attachment
      Alan O'Keefe wrote:
      >Hi all
      >
      >I am running a SOAP::Lite service, (SOAP::Transport::HTTP), which
      >returns an array of hashes to a nuSOAP PHP client, it all works fine,
      >except that the Daemon running the SOAP service outputs the following
      >warning for each hash in the array:
      >
      >Cannot encode 'item' element as 'hash'. Will be encoded as 'map' instead
      >
      >Everything works perfectly, I just want to stop the warning message.

      The warning is probably caused by one of your hash keys having a character that is not valid in an XML element name. Possibly a space character but it could be almost anything.
      The solution is to either change your hash keys or explicitly type the hash as a map type. I don't remember the syntax offhand but it might be

      SOAP::Data->type('map', \%hash)
      If you search the archives of this list you should find that this has been asked in the past and get an example.

      Regards
      Duncan Cameron
    • Alan O'Keefe
      Hi Duncan Thanks for the response, I did do a search of the archives, but probably didn t frame my search criteria properly, I ll have another look. Thanks
      Message 2 of 2 , Jun 10, 2004
      • 0 Attachment
        Hi Duncan

        Thanks for the response, I did do a search of the archives, but probably
        didn't frame my search criteria properly, I'll have another look.

        Thanks
        Alan


        On Thu, 2004-06-10 at 22:34, Duncan Cameron wrote:
        > Alan O'Keefe wrote:
        > >Hi all
        > >
        > >I am running a SOAP::Lite service, (SOAP::Transport::HTTP), which
        > >returns an array of hashes to a nuSOAP PHP client, it all works fine,
        > >except that the Daemon running the SOAP service outputs the following
        > >warning for each hash in the array:
        > >
        > >Cannot encode 'item' element as 'hash'. Will be encoded as 'map' instead
        > >
        > >Everything works perfectly, I just want to stop the warning message.
        >
        > The warning is probably caused by one of your hash keys having a character that is not valid in an XML element name. Possibly a space character but it could be almost anything.
        > The solution is to either change your hash keys or explicitly type the hash as a map type. I don't remember the syntax offhand but it might be
        >
        > SOAP::Data->type('map', \%hash)
        > If you search the archives of this list you should find that this has been asked in the past and get an example.
        >
        > Regards
        > Duncan Cameron
        --
        Alan O'Keefe <alan@...>
        O'Keefe Systems Consulting
      Your message has been successfully submitted and would be delivered to recipients shortly.