IT Process Automation

  • 1.  Parsing response XML

    Posted Mar 24, 2014 01:45 PM
     
    HI,
    I am using the SOAP operator for doSelect web service for fetching the detail of incident from SDM  and trying to parse the response XML.
    But After defining the Xpath variable dataset in the Call Result option like...
     
    xpath expression: //summary/text()
    Dataset Variable: XpathResult
    Type:String
     
    It is not showing the values under the operation result for summary and description.
     
    Getting the doSelect query result in the below format.
     

    <doSelectResponse xmlns="http://www.ca.com/UnicenterServicePlus/ServiceDesk">

    <doSelectReturn xmlns="">&lt;?xml version="1.0" encoding="UTF-8"?&gt;

    &lt;UDSObjectList&gt;

    &lt;UDSObject&gt;

    &lt;Handle&gt;cr:400388&lt;/Handle&gt;

    &lt;Attributes&gt;

    &lt;Attribute DataType="2002"&gt;

    &lt;AttrName&gt;summary&lt;/AttrName&gt;

    &lt;AttrValue&gt;Testing.......&lt;/AttrValue&gt;

    &lt;/Attribute&gt;

    &lt;Attribute DataType="2002"&gt;

    &lt;AttrName&gt;description&lt;/AttrName&gt;

    &lt;AttrValue&gt;Testing......&lt;/AttrValue&gt;

    &lt;/Attribute&gt;

    &lt;/UDSObject&gt;
    &lt;/UDSObjectList&gt;
    </doSelectReturn>
    </doSelectResponse>

    I am not sure how to convert it in standard xml format which can be understandable by call result option in PAM for parsing the variable value.

    Can anyone please guide me.

    Thanks,

    Manish



  • 2.  RE: Parsing response XML

    Posted Mar 25, 2014 01:30 AM

    Hi,

     

    I am not sure if java script will help us to conver it in standard xml.

    It will be great if anyone can share a thought how to convert it.

    Thanks,

    Manish



  • 3.  RE: Parsing response XML

    Posted Mar 25, 2014 03:00 AM

    i am getting summary and other information by using getobjectvalues method



  • 4.  RE: Parsing response XML
    Best Answer

    Posted Mar 25, 2014 07:18 AM

    Thanks for your response.

     



  • 5.  RE: Parsing response XML

    Posted Mar 25, 2014 02:36 PM

    The issue is that SDM returns XML within XML, which as far as I know is not common.  So you first have to get to the "inner XML" by using XPath and then run more queries against that inner XML.

    In your example, //doSelectReturn should get you to your inner XML and then you can query against that result.  You will have to do the same when using the SDM getObjectValues method.

    Thanks,
    Tom