ошибка при демаршалинге от sml до java - PullRequest
1 голос
/ 23 февраля 2020
Caused by: org.springframework.http.converter.HttpMessageNotReadableException: Could not unmarshal to [class com.vodafone.partnerservices.paymentpage.decoupling.response.beans.v2.ErResponse]: unexpected element (uri:"", local:"er-response"). Expected elements are <{http://localhost:8080/decoupling/schemas/v2/common}er-response>,<{}full-account-v2>,<{}full-accounts-response>,<{}get-next-payment-amount-response-v2>,<{}selfcare-full-subscriptions-v2>,<{}selfcare-full-transactions-v2>; nested exception is javax.xml.bind.UnmarshalException: unexpected element (uri:"", local:"er-response"). Expected elements are <{http://localhost:8080/decoupling/schemas/v2/common}er-response>,<{}full-account-v2>,<{}full-accounts-response>,<{}get-next-payment-amount-response-v2>,<{}selfcare-full-subscriptions-v2>,<{}selfcare-full-transactions-v2>
    at org.springframework.http.converter.xml.AbstractXmlHttpMessageConverter.readInternal(AbstractXmlHttpMessageConverter.java:75)
    at org.springframework.http.converter.AbstractHttpMessageConverter.read(AbstractHttpMessageConverter.java:199)
    at org.springframework.web.client.HttpMessageConverterExtractor.extractData(HttpMessageConverterExtractor.java:113)
    ... 94 more
Caused by: javax.xml.bind.UnmarshalException: unexpected element (uri:"", local:"er-response"). Expected elements are <{http://localhost:8080/decoupling/schemas/v2/common}er-response>,<{}full-account-v2>,<{}full-accounts-response>,<{}get-next-payment-amount-response-v2>,<{}selfcare-full-subscriptions-v2>,<{}selfcare-full-transactions-v2>

классы выглядят так

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "payload"
})
@XmlRootElement(name = "er-response")
public class ErResponse
    implements Serializable, Element
{

    private final static long serialVersionUID = 1L;
    @XmlElement(required = true)
    protected PayloadType payload;

Тип загрузки выглядит следующим образом:

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "payloadType", namespace = "http://localhost:8080/decoupling/schemas/v2/common", propOrder = {
    "any"
})
public class PayloadType
    implements Serializable, javax.xml.bind.Element
{

    private final static long serialVersionUID = 1L;
    @XmlAnyElement(lax = true)
    protected SelfcareFullSubscriptionsV2 any;

SelfcareFullSubscriptionV2 выглядит так:

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "subscription"
})
@XmlRootElement(name = "selfcare-full-subscriptions-v2", namespace = "")
public class SelfcareFullSubscriptionsV2
    implements Serializable, Element
{

    private final static long serialVersionUID = 1L;
    protected List<Subscription> subscription;

Не в состоянии понять, что это проблема, любой указатель будет полезен.

...