38 lines
1020 B
Go
38 lines
1020 B
Go
package response
|
|
|
|
import (
|
|
"encoding/xml"
|
|
)
|
|
|
|
type SoapEnvelopePaisOrigen struct {
|
|
XMLName xml.Name `xml:"Envelope"`
|
|
Body SoapBodyPaisOrigen `xml:"Body"`
|
|
}
|
|
|
|
type SoapBodyPaisOrigen struct {
|
|
Response SincronizarResponsePaisOrigen `xml:"sincronizarParametricaPaisOrigenResponse"`
|
|
}
|
|
|
|
type SincronizarResponsePaisOrigen struct {
|
|
RespuestaLista RespuestaListaParametricasPaisOrigen `xml:"RespuestaListaParametricas"`
|
|
}
|
|
|
|
type RespuestaListaParametricasPaisOrigen struct {
|
|
Transaccion bool `xml:"transaccion"`
|
|
ListaCodigos []PaisOrigen `xml:"listaCodigos"`
|
|
}
|
|
|
|
type PaisOrigen struct {
|
|
CodigoClasificador string `xml:"codigoClasificador" json:"codigo"`
|
|
Descripcion string `xml:"descripcion" json:"descripcion"`
|
|
}
|
|
|
|
// Implementaciones para cada tipo de envelope
|
|
func (e SoapEnvelopePaisOrigen) IsTransactionSuccessful() bool {
|
|
return e.Body.Response.RespuestaLista.Transaccion
|
|
}
|
|
|
|
func (e SoapEnvelopePaisOrigen) GetData() []PaisOrigen {
|
|
return e.Body.Response.RespuestaLista.ListaCodigos
|
|
}
|