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

Re: newbie - SOAP::Custom::XML::Data serialization problem

Expand Messages
  • Lukasz Guminski
    ... Thank you very much! But I ve already found this solution after analysis of SOAP::Lite code and It s hard to use:( As I wrote, the object I want to be
    Message 1 of 3 , Jul 22, 2003
      --- In soaplite@yahoogroups.com, Eric Amick <eric-amick@c...> wrote:
      >
      > > I was trying to force (no matter why) my CGI SOAP server to return a
      > > response like this (stripped namespace declarations and types):
      > >
      > > <SOAP-ENV:Envelope>
      > > <SOAP-ENV:Body>
      > > <namesp1:GetObjectResponse>
      > > <Rows>
      > > <Row>
      > > <Name xsi:type="xsd:string">FirstRow</Name>
      > > <Value xsi:type="xsd:int">1</Value>
      > > </Row>
      > > <Row>
      > > <Name xsi:type="xsd:string">SecondRow</Name>
      > > <Value xsi:type="xsd:int">2</Value>
      > > </Row>
      > > <Rows>
      > > </namesp1:GetObjectResponse>
      > > </SOAP-ENV:Body>
      > > </SOAP-ENV:Envelope>
      > >
      > > so I've made a piece of a server code:
      > >
      > > sub GetObjectResponse
      > > {
      > > return SOAP::Data->name('Rows')->value(
      > > SOAP::Data->name('Row')->value(
      > > SOAP::Data->name('Name')->value('FirstRow'),
      > > SOAP::Data->name('Value')->value('1')
      > > ),
      > > SOAP::Data->name('Row')->value(
      > > SOAP::Data->name('Name')->value('SecondRow'),
      > > SOAP::Data->name('Value')->value('2')
      > > )
      > > );
      > > }
      > >
      > > but it resulted with answer:
      > >
      > > <SOAP-ENV:Envelope>
      > > <SOAP-ENV:Body>
      > > <namesp1:GetObjectResponse>
      > > <Name>FirstRow</Name>
      > > <Value>1</Value>
      > > <Name>SecondRow</Name>
      > > <Value>2</Value>
      > > </namesp1:GetObjectResponse>
      > > </SOAP-ENV:Body>
      > > </SOAP-ENV:Envelope>
      > >
      > > As you can see - "Rows" and "Row" elements are lost. Can anybody
      > > say why?
      >
      > I believe you need:
      >
      > sub GetObjectResponse
      > {
      > return SOAP::Data->name('Rows')->value(
      > \SOAP::Data->name('Row')->value(
      > SOAP::Data->name('Name')->value('FirstRow'),
      > SOAP::Data->name('Value')->value('1')
      > ),
      > \SOAP::Data->name('Row')->value(
      > SOAP::Data->name('Name')->value('SecondRow'),
      > SOAP::Data->name('Value')->value('2')
      > )
      > );
      > }

      Thank you very much! But I've already found this solution after
      analysis of SOAP::Lite code and It's hard to use:( As I wrote, the
      object I want to be returned, is build not by me but by the SOAP::Lite
      library after deserialization of result of other SOAP call. And there
      are no references - I would have to traverse recursivly the structure
      and (with my own hands:)) from time to time replace objects with
      references of them. Why is it imposible to transparently return
      SOAP::Data object returned from previous SOAP call? It's illogical for
      me that the programmer's intervension is required...

      Lukasz Guminski

      >
      >
      > Eric Amick
      > Columbia, MD
    Your message has been successfully submitted and would be delivered to recipients shortly.