Hi,
I'm trying to use Xml2Map class to get values from XML that is passed back from a WCF. I followed the example in the first post to loop through the data from the XML string but, changed the XML references as per my output, however I get a compilation error as follows;
Here's the XML response from the WCF;
The B4X code I'm using is as follows;
Have I missed something in my code?
Thanks.
I'm trying to use Xml2Map class to get values from XML that is passed back from a WCF. I followed the example in the first post to loop through the data from the XML string but, changed the XML references as per my output, however I get a compilation error as follows;
B4X:
Compiling generated Java code. Error
B4A line: 105
For Each res As Map In root.Get(\
javac 1.8.0_131
src\b4a\example\main.java:485: error: incompatible types: Object cannot be converted to IterableList
group26 = _root.Get((Object)("GetDataResponse"));
Here's the XML response from the WCF;
B4X:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<ActivityId CorrelationId="8709d988-7118-46e3-a65f-4d81be46993e" xmlns="http://schemas.microsoft.com/2004/09/ServiceModel/Diagnostics">a98d95ae-573d-4636-aadc-738ee383269e</ActivityId>
</s:Header>
<s:Body>
<GetDataResponse xmlns="http://tempuri.org/">
<GetDataResult>You entered: 100</GetDataResult>
</GetDataResponse>
</s:Body>
</s:Envelope>
The B4X code I'm using is as follows;
B4X:
Dim xm As Xml2Map
xm.Initialize
ParsedData = xm.Parse(strXMLResponse)
Dim root As Map = ParsedData.Get("Body")
For Each res As Map In root.Get("GetDataResponse")
Next
Have I missed something in my code?
Thanks.