I get the error
Android Magento Soap Api org.simpleframework.xml.core.PersistenceException: Element 'result' is already used with @org.simpleframework.xml.ElementList
when I make request to fetch catalogProductMedia from Magento using Soap. Below are XML files and Classes.
<message name="catalogProductAttributeMediaListResponse">
<part name="result" type="typens:catalogProductImageEntityArray"/>
</message>
@Root(name = CatalogProductAttributeMediaListResponse.ROOT_NAME, strict = false)
public class CatalogProductAttributeMediaListResponse {
public static final String ROOT_NAME = "n0:catalogProductAttributeMediaListResponse";
@Element(required = false)
@Path("Body/catalogProductAttributeMediaListResponse")
private CatalogProductImageEntityArray result;
}
<complexType name="catalogProductImageEntityArray">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" wsdl:arrayType="typens:catalogProductImageEntity[]"/>
</restriction>
</complexContent>
</complexType>
@Root(name = "catalogProductImageEntityArray", strict = false)
public class CatalogProductImageEntityArray {
@ElementList(inline = true, entry = "item", required = false)
private List<CatalogProductImageEntity> productImageEntityList;
}
<complexType name="catalogProductImageEntity">
<all>
<element name="file" type="xsd:string"/>
<element name="label" type="xsd:string"/>
<element name="position" type="xsd:string"/>
<element name="exclude" type="xsd:string"/>
<element name="url" type="xsd:string"/>
<element name="types" type="typens:ArrayOfString"/>
</all>
</complexType>
@Root(name = "catalogProductEntity", strict = false)
public class CatalogProductImageEntity {
@Element(required = false)
private String url;
}
i just want to fetch url and i have already generated all the getter and setter methods. Help Me Please
Try to annotate result like
@Element(required = false, inline=true)
@Path("Body/catalogProductAttributeMediaListResponse")
private CatalogProductImageEntityArray result;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.