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

SOAP::Data->value() can it take SOAP::Data?

Expand Messages
  • Jamie Curmi
    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
    Message 1 of 3 , Jul 14, 2002
      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
    • Duncan Cameron
      ... Something along these lines will give you what you re looking for: return SOAP::Data- name( Foo ) - value({ Bar = SOAP::Data- type(int = 12) } );
      Message 2 of 3 , Jul 14, 2002
        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
      • Jamie Curmi
        Thanks Duncan. I really appreciate the help. Wish I d found this mailing list earlier today. :-) Jamie
        Message 3 of 3 , Jul 14, 2002
          Thanks Duncan. I really appreciate the help. Wish I'd found this
          mailing list earlier today. :-)

          Jamie

          On Sunday, July 14, 2002, at 07:26 pm, Duncan Cameron wrote:
          > 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
        Your message has been successfully submitted and would be delivered to recipients shortly.