Enrich Data by Web Service - how to parse the response
Hi,
I'm trying to perform following task in RapidMiner - request the data from a web-service, and then parse the response as a data set.
the response from the server is returned as XML and i can do it successfully.
This i was able to successfully do with Enrich Data by Webservice operation.
As a result, i have a table of form
Row No. InputParameter Response
1 1111111111 <here is my response in XML>
How can i parse now the response from this column and convert it to a data set?
I tried different operations, e.g. Process Documents from Data but it compains about "The example set must contain at least one text attribute".
So, how and where do i set this text attribute?
I tried to Google for some minimal example, but did not find.
Answers
does your Xpath statement contain /text() ? that will extrac the text and put it into an attribute column. You can check out my example with Open Street Map data here: http://www.neuralmarkettrends.com/Extracting-OpenStreetMap-Data-In-RapidMiner/
Hi Thomas,
thank you for replying me! But, my problem is a bit different. In your example, you call web service for each input row, and then just append returned value, queried by XPath.
In my case, i have to make one call, retrieve XML which contains collection of objects, about 20. Now, i need to apply XPath to get these 20 rows, and i cannot do it. It just selects one element from collection and that's it.
My XML looks like:
So, i need to turn all the entries for CreditBureauData into data rows.
Ok,
In that case try an Open File operator, set to the URL you want and connect it to a Read XML operator. You'll ping the XML file and then download it all and parse it with the Read XML opreator into an exampleset.
But, i need to POST some parameters in a body to that URL in order to get the data.
This XML is a response from a web-service.
Open File does not support POSTing, does it?
Get Page will work, it has a a POST parameter.