Ask a Question

XML datasource question

alibaba82
Super Contributor

XML datasource question

Hello,
I have a response in which one of the element has an XML. So an XML within an  XML. I need to know how I can use XML datasource step to populate my datasource with this embedded XML. below is the response I get. The element with the embedded XML is 'XMLResponse'.



            <ApiResult><Results><Result>True</Result><ErrorCode/><Messages><Message/><MessageId>f81ae5ae-43a0-4510-8326-1f1dc1cd2372</MessageId></Messages></Results></ApiResult>
       
     
 
3 REPLIES 3
omatzura
Super Contributor

Re: XML datasource question

Hi Ali,

try transferring the content of the XmlResponse element to a properties-step property, and then setting that property as the source property in your DataSource..

regards!

/Ole
eviware.com
MeenuK
Not applicable

Re: XML datasource question

Hi Ole,

I trasfered XMl response in Property Trasfer step as a [source] and target is [Properties]  where I want to get each element seperately from XML response .

when I tried to do I am getting error message
Tue Nov 13 10:43:43 PST 2007 XmlResponse [error: Unexpected end of file after null]

Trasfers -
XMlResponse

Here is source steps :
declare namespace ns1='http://services.aaaa.com/v3/smsmessage';
//ns1:CreateMessageUsingPhoneResponse/ns1:CreateMessageUsingPhoneResult/ns1:XmlResponse


Here is target steps :
//ApiResult[1]/Results/Messages/MessageId
SLuong
Contributor

Re: XML datasource question

You may want to try using
Row XPath as //ApiResult[1]
and declaring each column with the exact path:
/Results/Messages/MessageId
to get each xml value
cancel
Showing results for 
Search instead for 
Did you mean: