Parse Response XML

145 views
Skip to first unread message

manish gupta

unread,
Mar 24, 2014, 1:34:58 PM3/24/14
to itpam...@googlegroups.com
 
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|//description
Dataset Variable: XpathResult
Type:String Array
 
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>

Can anyone please guide me

 

Thanks,

Manish

Cindy Kube

unread,
Mar 25, 2014, 11:48:17 AM3/25/14
to itpam...@googlegroups.com

I would try:

 

xpath expression: //Attribute[AttrName='summary']/AttrValue

Dataset Variable: XpathResult_summary

Type:String

 

xpath expression: //Attribute[AttrName=’description’]/AttrValue

Dataset Variable: XpathResult_description

Type:String

--
You received this message because you are subscribed to the Google Groups "CA Process Automation Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to itpam-forum...@googlegroups.com.
To post to this group, send email to itpam...@googlegroups.com.
Visit this group at http://groups.google.com/group/itpam-forum.
For more options, visit https://groups.google.com/d/optout.

Spencer Sivakumaran

unread,
Mar 25, 2014, 1:15:17 PM3/25/14
to itpam...@googlegroups.com

When we use SOAP operators we parse the response directly in the operator.

On the Properties of the Operator we add  to the Call Results tab

To return meaningful XML we create a new Additional Extracted Data as below

X-Path: //doSelectReturn

Dataset Variable: soapResponse

Type: String

This gives us a process variable called soapResponse

 

<?xml version="1.0" encoding="UTF-8"?>

<UDSObjectList>
 <UDSObject>
  <Handle>cnt:012344BDB86A2540B922B4A640CB02D3</Handle>
  <Attributes>
   <Attribute DataType="2005">
    <AttrName>zhdisync</AttrName>
    <AttrValue>0</AttrValue>
   </Attribute>
   <Attribute DataType="2002">
    <AttrName>ztenantprptpl_values</AttrName>
    <AttrValue/>
   </Attribute>
'
'
'
'
   <Attribute DataType="2005">
    <AttrName>organization</AttrName>
    <AttrValue/>
   </Attribute>
  </Attributes>
 </UDSObject>
</UDSObjectList>

 

 

Which you should be able to use xpath on

 

Cheers
Spencer

 


From: Cindy...@RaymondJames.com
To: itpam...@googlegroups.com
Subject: RE: [ITPAM FORUM] Parse Response XML
Date: Tue, 25 Mar 2014 15:48:17 +0000
Reply all
Reply to author
Forward
0 new messages