Я не могу принести xml список дооснащения - PullRequest
0 голосов
/ 19 апреля 2020

Мне нужно было привести описания, но когда я пытаюсь вывести этот список, я не могу.

<ArrayOfVariableRow xmlns="http://schemas.datacontract.org/2004/07/Prysm.AppVision.Data" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
    <VariableRow>
        <Description>Agencia3</Description>
        <FullDescription>App/Agencia0001</FullDescription>
        <Id>4101</Id>
        <Name>App.AGENCIA0001</Name>
        <Address i:nil="true"/>
</Variable>
    <VariableRow>
        <Description>Agencia5</Description>
        <FullDescription>App/Agencia5</FullDescription>
        <Id>4101</Id>
        <Name>App.AGENCIA0002</Name>
        <Address i:nil="true"/>
</Variable>

Класс GetNamesButtons

package com.anyvision.facekeyexample.models;
import java.util.List;
import org.simpleframework.xml.Element;
import org.simpleframework.xml.ElementList;
import org.simpleframework.xml.Path;
import org.simpleframework.xml.Root;

@Root(name="ArrayOfVariableRow", strict=false)
public class GetNameButtons {

@Element(name="Description")
@Path("VariableRow")
private String nmButtonAgencia;

    @ElementList(name="Description", inline = true)
    @Path("VariableRow")
    private List<DescriptionsAgencia> nmButtonsAgenciaList;

    public String getButtonAgencia() {
        return nmButtonAgencia;
    }

    public List<DescriptionsAgencia> getButtonAgenciaList() {
        return nmButtonsAgenciaList;
    }
}

Класс ОписанияAgencia

package com.anyvision.facekeyexample.models;
import org.simpleframework.xml.Element;
import org.simpleframework.xml.Root;

//@Root(name="Description", strict=false)
@Root(name="VariableRow", strict=false)
public class DescriptionsAgencia {

    @Element(name="Description")
    private String description;

    public String getDescription(){
        return description;
    }

}

Дооснащение

     public void GetVariablesByFilter(final String SessionID) {
            setServerLocalUrl(GetVariables.getInstance().getServerUrl());

            Retrofit retrofit = new Retrofit.Builder()
                    .baseUrl(serverLocalUrl)
                    .addConverterFactory(SimpleXmlConverterFactory.create())
                    .build();
            AuthToken tokenAuth = retrofit.create(AuthToken.class);

            Call<GetNameButtons> call = tokenAuth.GetVariableAgencia(SessionID);

            call.enqueue(new Callback<GetNameButtons>() {
                @Override
                public void onResponse(Call<GetNameButtons> call, Response<GetNameButtons> response) {

                    if(response.isSuccessful()){
                        GetNameButtons nmButton = response.body();


//nmButtonsAgencia  is List
                        //nmButtonsAgencia = nmButton.getButtonAgenciaList();


                        //Log.d("auth", nmButton.getButtonAgencia());

                        Log.d("auth", response.toString());
                        Log.d("auth", response.message());
                        Log.d("auth", response.body().toString());

                    } else {
                        Log.d("auth", response.errorBody().toString());
                    }
                    }
                @Override
                public void onFailure(Call<GetNameButtons> call, Throwable t) {
                    Log.d("auth", t.getMessage());
                }
            });

До того, как я сделал тест в посте и приводил его, но я просто не могу привести информацию здесь в коде. Мне удалось принести еще 1 информацию, необходимую для описания всех возможных описаний. Пожалуйста, я не могу решить

...