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

SOAP::SOM->dataof() bug?

Expand Messages
  • Taras Shkvarchuk
    Hello all, I have noticed that SOM- dataof() call, does not return the whole hierarchy of the node. only immediate level, and even that is kind of strange. It
    Message 1 of 2 , Aug 9 12:08 PM
    • 0 Attachment
      Hello all,
      I have noticed that SOM->dataof() call, does not return the whole hierarchy of the node. only immediate level, and even that is kind of strange. It will take data out of node's children and stick it into the node itself.
       
      Source SOAP:
      <SOAP-ENV:Body xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
          <namesp2:Query SOAP-ENC:arrayType="xsd:int[1]" kind="test" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:namesp2="http://namespace.grandcentral.com/taras/catalog/1.0" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xsi:type="SOAP-ENC:Array">
            <UPID xsi:type="xsd:int">123</UPID>
          </namesp2:Query>
      </SOAP-ENV:Body>
       
      SOM->dataof() constructs this:
      <SOAP-ENV:Body>
          <Query xmlns:namesp2="http://namespace.grandcentral.com/taras/catalog/1.0" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENC:arrayType="xsd:int[1]" kind="test" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xsi:type="SOAP-ENC:Array">
            <item xsi:type="xsd:int">123</item>
          </Query>
      </SOAP-ENV:Body>
       
      As you can see the UPID node is lost, but it managed to get its value...
       
      P.S. Is there something else I can call to get complete SOAP::Data object from SOAP::SOM? Or I need to traverse the tree in my code and build the object?
       
      Thanks,
      -Taras
    • Paul Kulchenko
      Hi, Taras! ... Yes, that s right. SOAP::Data returns full information about current node, but child element will be stored as a Perl datastructures. I plan to
      Message 2 of 2 , Aug 9 12:33 PM
      • 0 Attachment
        Hi, Taras!

        > I have noticed that SOM->dataof() call, does not return the whole
        > hierarchy
        > of the node. only immediate level, and even that is kind of
        > strange. It will
        Yes, that's right. SOAP::Data returns full information about current
        node, but child element will be stored as a Perl datastructures.

        I plan to add ->alldataof method that will return SOAP::Data with
        recursive SOAP::Data elements that describe XML fragment. SOAP::SOM
        object is also planned to be reversable, so you'll be able to
        recreate XML from it.

        > P.S. Is there something else I can call to get complete SOAP::Data
        > object
        > from SOAP::SOM? Or I need to traverse the tree in my code and build
        As alternative you may do something similar to what was done in
        UDDI::Lite. Create custom Serializer and Deserializer and recreate
        XML based on information stored in elements. It's not very convenient
        to work with XML payload directly, because goal was to hide this
        level from user :). There are some methods and I plan to add more, to
        simplify interface for managing and building XML messages.

        Best wishes, Paul.

        --- Taras Shkvarchuk <tshkvarchuk@...> wrote:
        > Hello all,
        > I have noticed that SOM->dataof() call, does not return the whole
        > hierarchy
        > of the node. only immediate level, and even that is kind of
        > strange. It will
        > take data out of node's children and stick it into the node itself.
        >
        > Source SOAP:
        > <SOAP-ENV:Body
        > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
        > <namesp2:Query SOAP-ENC:arrayType="xsd:int[1]" kind="test"
        > xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
        > xmlns:namesp2="http://namespace.grandcentral.com/taras/catalog/1.0"
        > xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
        > xsi:type="SOAP-ENC:Array">
        > <UPID xsi:type="xsd:int">123</UPID>
        > </namesp2:Query>
        > </SOAP-ENV:Body>
        >
        > SOM->dataof() constructs this:
        > <SOAP-ENV:Body>
        > <Query
        > xmlns:namesp2="http://namespace.grandcentral.com/taras/catalog/1.0"
        > xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
        > SOAP-ENC:arrayType="xsd:int[1]" kind="test"
        > xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
        > xsi:type="SOAP-ENC:Array">
        > <item xsi:type="xsd:int">123</item>
        > </Query>
        > </SOAP-ENV:Body>
        >
        > As you can see the UPID node is lost, but it managed to get its
        > value...
        >
        > P.S. Is there something else I can call to get complete SOAP::Data
        > object
        > from SOAP::SOM? Or I need to traverse the tree in my code and build
        > the
        > object?
        >
        > Thanks,
        > -Taras
        >


        __________________________________________________
        Do You Yahoo!?
        Make international calls for as low as $.04/minute with Yahoo! Messenger
        http://phonecard.yahoo.com/
      Your message has been successfully submitted and would be delivered to recipients shortly.