I am attempting to generate an object from incoming XML string. This is the incoming payload which shows as a java.string after converting it from byte array to object:
<?xml version="1.0" encoding="utf-8"?>
<EnumerationResults ContainerName="http://xxx.blob.core.windows.net/123/">
<Blobs>
<Blob>
<Name>stuff.csv</Name><Url>http://xxx.blob.core.windows.net/123/location.csv</Url><LastModified>Tue, 25 Aug 2015 18:19:58 GMT</LastModified><Etag>0x8D2AD79C8DFFFFF</Etag>
<Size>177</Size>
<ContentType>application/octet-stream</ContentType>
<ContentEncoding /><ContentLanguage />
</Blob>
</Blobs>
<NextMarker />
</EnumerationResults>"
I created a class that I tried to map the above with:
public class EnumerationResults implements java.io.Serializable{
static final long serialVersionUID = 1;
private List<Blob> Blobs;
private String NextMarker;
private String ContainerName;
public EnumerationResults(){}
public List<Blob> getBlobs() {
return Blobs;
}
public void setBlobs(List<Blob> Blobs) {
this.Blobs = Blobs;
}
public String getNextMarker(){
return NextMarker;
}
public void setNextMarker(String NextMarker){
this.NextMarker = NextMarker;
}
}
using an Xml to Object transformer or a XML to JAXB transformer, but got :
org.mule.api.transformer.TransformerMessagingException: EnumerationResults (com.thoughtworks.xstream.mapper.CannotResolveClassException). Message payload is of type: String
Could someone tell me what the best approach to transforming this would be? I have also tried object to JSON and then tried mapping JSON to the java class but the mapper through errors.
Thanks for any input.