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

Cannot encode 'hash' element as 'hash'.

Expand Messages
  • Andre Merzky
    Well, that looks like a bug to me... - where should I report bugs for SOAP::Lite? On this list? Here are two versions of code: version A works fine, version B
    Message 1 of 3 , May 28 9:20 AM
    • 0 Attachment
      Well, that looks like a bug to me... - where should I report
      bugs for SOAP::Lite? On this list?

      Here are two versions of code: version A works fine, version
      B complains with:

      Cannot encode 'hash' element as 'hash'.
      Will be encoded as 'map' instead

      First defining the hash as a variable doe snot help.

      I would guess that the star (*), the only difference between
      A and B, gets somewhere interpreted, e.g. in a regular
      expression. Anybody an idea where I should dig?

      Andre.


      Version A)

      my $ns = "My_NameSpace";
      my $service = SOAP::Lite -> proxy ('http://localhost:1234/')
      -> uri ($ns);
      my $method = SOAP::Data -> name ('FindAdverts')
      -> attr ({xmlns => $ns});
      my $payload = (SOAP::Data -> name ('data')
      -> type ('ordered hash')
      -> value ({'hash' => {'test_1.x' => 'TEST ..'}}));
      my $response = $service -> call ($method => $payload);


      Version A)

      my $ns = "My_NameSpace";
      my $service = SOAP::Lite -> proxy ('http://localhost:1234/')
      -> uri ($ns);
      my $method = SOAP::Data -> name ('FindAdverts')
      -> attr ({xmlns => $ns});
      my $payload = (SOAP::Data -> name ('data')
      -> type ('ordered hash')
      -> value ({'hash' => {'test_1.*' => 'TEST ..'}}));
      my $response = $service -> call ($method => $payload);


      note: A: 'test_1.x'
      B: 'test_1.*'

      --
      +-----------------------------------------------------------------+
      | Andre Merzky | phon: +31 - 20 - 598 - 7759 |
      | Vrije Universiteit Amsterdam (VU) | fax : +31 - 20 - 598 - 7653 |
      | Dept. of Computer Science | mail: merzky@... |
      | De Boelelaan 1083a | www: http://www.merzky.net |
      | 1081 HV Amsterdam, Netherlands | |
      +-----------------------------------------------------------------+
    • Andre Merzky
      Aaaahh... - I see.. - good one! Sorry for shouting BUG w/o understanding it really :-/ :) Andre. ... --
      Message 2 of 3 , May 28 12:52 PM
      • 0 Attachment
        Aaaahh... - I see.. - good one! Sorry for shouting "BUG"
        w/o understanding it really :-/ :)

        Andre.


        Quoting [Duncan Cameron] (May 28 2005):
        >
        > On 2005-05-28 at 16:20:10 Andre Merzky wrote:
        >
        > >Well, that looks like a bug to me... - where should I report
        > >bugs for SOAP::Lite? On this list?
        > >
        > >Here are two versions of code: version A works fine, version
        > >B complains with:
        > >
        > > Cannot encode 'hash' element as 'hash'.
        > > Will be encoded as 'map' instead
        > >
        > >First defining the hash as a variable doe snot help.
        > >
        > >I would guess that the star (*), the only difference between
        > >A and B, gets somewhere interpreted, e.g. in a regular
        > >expression. Anybody an idea where I should dig?
        > >
        > >Andre.
        > The problem is that the hash key will be used as the element name in
        > the SOAP message, and '*' is not a valid character in an XML element
        > name.
        >
        > Regards
        > Duncan



        --
        +-----------------------------------------------------------------+
        | Andre Merzky | phon: +31 - 20 - 598 - 7759 |
        | Vrije Universiteit Amsterdam (VU) | fax : +31 - 20 - 598 - 7653 |
        | Dept. of Computer Science | mail: merzky@... |
        | De Boelelaan 1083a | www: http://www.merzky.net |
        | 1081 HV Amsterdam, Netherlands | |
        +-----------------------------------------------------------------+
      • Duncan Cameron
        ... The problem is that the hash key will be used as the element name in the SOAP message, and * is not a valid character in an XML element name. Regards
        Message 3 of 3 , May 28 1:48 PM
        • 0 Attachment
          On 2005-05-28 at 16:20:10 Andre Merzky wrote:

          >Well, that looks like a bug to me... - where should I report
          >bugs for SOAP::Lite? On this list?
          >
          >Here are two versions of code: version A works fine, version
          >B complains with:
          >
          > Cannot encode 'hash' element as 'hash'.
          > Will be encoded as 'map' instead
          >
          >First defining the hash as a variable doe snot help.
          >
          >I would guess that the star (*), the only difference between
          >A and B, gets somewhere interpreted, e.g. in a regular
          >expression. Anybody an idea where I should dig?
          >
          >Andre.
          The problem is that the hash key will be used as the element name in
          the SOAP message, and '*' is not a valid character in an XML element
          name.

          Regards
          Duncan
        Your message has been successfully submitted and would be delivered to recipients shortly.