1

I have following savon response: (contains notes, and other attributes such as create date, create user, location etc)

<?xml version="1.0" encoding="UTF-8"?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
   <S:Body>
      <ns2:getSomeAPIResponse xmlns:ns2="http://v2_0.some.webservices.csx.dtv.com/">
         <return type="COMMENT" createDate="2013-11-21T10:32:17.000Z" createUser="5" location="BOSTON">my fifth note</return>
         <return type="COMMENT" createDate="2013-11-21T09:04:18.000Z" createUser="POSSTD" location="BOSTON">fourth note</return>
         <return type="COMMENT" createDate="2013-11-21T08:49:20.000Z" createUser="POSSTD" location="BOSTON">third note</return>
         <return type="COMMENT" createDate="2013-11-21T08:43:42.000Z" createUser="POSSTD" location="BOSTON">second note</return>
         <return type="COMMENT" createDate="2013-11-21T08:43:42.000Z" createUser="POSSTD" location="BOSTON">first note</return>
      </ns2:getSomeAPIResponse >
   </S:Body>
</S:Envelope>

When I try to get the response.body, it contains the notes but not the attribures such as create user, create date, location etc. which are missing, as in:

{:get_some_api_response=>
  {:return=>
    ["my fifth note",
     "fourth note",
     "third note",
     "second note",
     "first note"],
   :"@xmlns:ns2"=>"http://v2_0.some.webservices.csx.dtv.com/"}}

I need to have these attributes as well, if possible, in the response.body, or by any other possible means. Any help please?

1 Answers1

0

It looks something like this:

<?xml version="1.0" encoding="UTF-8"?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
   <S:Body>
      <ns2:rCResponse xmlns:ns2="http://v2_0.customer.webservices.csx.dtv.com/">
         <return ResponseCode="OK">
            <CustomerID>2072</CustomerID>
            <SignupDate>2013-11-13Z</SignupDate>
            </LastUpdateInfo>
            <Affiliation />
        <Notes>
               <Note createDate="2013-11-25T12:08:22.000Z" createUser="16" location="NCR">sixth note</Note>
               <Note createDate="2013-11-21T08:43:42.000Z" createUser="PSTD" location="BOSSTON">second note</Note>
               <Note createDate="2013-11-21T08:43:42.000Z" createUser="PSTD" location="BOSSTON">first note</Note>
               <MaskData>false</MaskData>
        </Notes>
            <CustomerCards />
            <MaskData>false</MaskData>
         </return>
      </ns2:rCResponse>
   </S:Body>
</S:Envelope>

I suspect this happens when the xml node element has both attribute and value. Any insight into such situation?