简体   繁体   English

ElementList中的Android Magento Soap PersistenceException

[英]Android Magento Soap PersistenceException in ElementList

I get the error 我得到错误

Android Magento Soap Api org.simpleframework.xml.core.PersistenceException: Element 'result' is already used with @org.simpleframework.xml.ElementList Android Magento Soap Api org.simpleframework.xml.core.PersistenceException:元素“结果”已与@ org.simpleframework.xml.ElementList一起使用

when I make request to fetch catalogProductMedia from Magento using Soap. 当我请求使用Soap从Magento获取catalogProductMedia时。 Below are XML files and Classes. 以下是XML文件和类。

CatalogProductAttributeMediaListResponse.xml CatalogProductAttributeMediaListResponse.xml

<message name="catalogProductAttributeMediaListResponse">
<part name="result" type="typens:catalogProductImageEntityArray"/>
</message>

CatalogProductAttributeMediaListResponse.java CatalogProductAttributeMediaListResponse.java

    @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;
}

CatalogProductImageEntityArray.xml CatalogProductImageEntityArray.xml

<complexType name="catalogProductImageEntityArray">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" wsdl:arrayType="typens:catalogProductImageEntity[]"/>
</restriction>
</complexContent>
</complexType>

CatalogProductImageEntityArray.java CatalogProductImageEntityArray.java

@Root(name = "catalogProductImageEntityArray", strict = false)
public class CatalogProductImageEntityArray {
    @ElementList(inline = true, entry = "item", required = false)
    private List<CatalogProductImageEntity> productImageEntityList;
}

CatalogProductImageEntity.xml CatalogProductImageEntity.xml

<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>

CatalogProductImageEntity.java CatalogProductImageEntity.java

@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. 我只想获取url,我已经生成了所有的getter和setter方法。 Help Me Please 请帮帮我

Try to annotate result like 尝试像这样注释结果

@Element(required = false, inline=true)
@Path("Body/catalogProductAttributeMediaListResponse")
private CatalogProductImageEntityArray result;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM