Невозможно получить тему конверта SOAP, отправителя, куб с помощью Retrofit 2 и Simple XML Converter - PullRequest
0 голосов
/ 08 декабря 2018

Я использую Retrofit 2.2.0 и Retrofit SimpleXML Converter 2.2.0.Я добавил SimpleXmlConverter в экземпляр Retrofit с помощью метода addConverterFactory.

Проблема заключается в том, что при получении ответа возникает следующая ошибка

java.lang.RuntimeException: org.simpleframework.xml.core.ElementException: элемент 'subject' не имеет совпадения в классе ResponseEnvelope в строке 1

Я должен получить XML-ответ, подобный следующему:

<hismos:Envelope xmlns:hismos="http://www.x3schools.com/xml/2002-08-01" xmlns="http://www.x3schools.com">
<hismos:subject>Reference rates</hismos:subject>
<hismos:Sender>
<hismos:name>Time to Stack Address</hismos:name>
</hismos:Sender>
<Cube>
    <Cube time="2018-12-07">
        <Cube country="USA" city="CA"/>
    </Cube>
</Cube>

@Root(name = "Envelope")@NamespaceList({
    @Namespace(prefix = "gesmes", reference = "http://www.gesmes.org/xml/2002-08-01"),
    @Namespace(reference = "http://www.ecb.int/vocabulary/2002-08-01/eurofxref")})final class ResponseEnvelope {

@Element
@Namespace(prefix = "gesmes")
private String subject;}
...