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

1691Re: [soaplite] SOAP::Data->value() can it take SOAP::Data?

Expand Messages
  • Duncan Cameron
    Jul 14, 2002
    • 0 Attachment
      On 2002-07-14 Jamie Curmi wrote:
      >Hi All,
      >
      >I'm very new to SOAP::Lite, and I seem to have a problem when I do
      >anything a little more complicated than the examples I can find on the
      >net.
      >
      >I'm writing a simple server. If my remote procedure returns:
      >
      > return SOAP::Data->name('FOO')->value(12);
      >
      >the client received XML of the following form, as expected (i'm using
      >outputxml('true') to see the XML returned):
      >
      > ...
      > <namesp1:hiResponse ...>
      > <FOO xsi:type="xsd:int">12</FOO>
      > </namesp1:hiResponse>
      > ...
      >
      >However, if I try to do:
      >
      > return SOAP::Data->name('FOO')->value(
      > SOAP::Data->name('BAR')->value(12));
      >
      >the client receives:
      >
      > ...
      > <namesp1:hiResponse ...">
      > <BAR xsi:type="xsd:int">12</BAR>
      > </namesp1:hiResponse>
      > ...
      >
      >ie, there is no FOO. I was expecting something along the lines of:
      >
      > ...
      > <FOO>
      > <BAR>12</BAR>
      > </FOO>
      > ...
      >
      >Can someone tell me what I am doing wrong?
      >
      >Thanks.
      >
      >Jamie
      >

      Something along these lines will give you what you're looking for:

      return SOAP::Data->name('Foo')
      ->value({
      Bar => SOAP::Data->type(int => 12)
      }
      );


      Regards,
      Duncan Cameron
    • Show all 3 messages in this topic