40 lines
1.1 KiB
Go
40 lines
1.1 KiB
Go
package response
|
|
|
|
import (
|
|
"encoding/xml"
|
|
)
|
|
|
|
// Estructuras para la respuesta SOAP.
|
|
type SoapEnvelopeActividad struct {
|
|
XMLName xml.Name `xml:"Envelope"`
|
|
Body SoapBodyActividad `xml:"Body"`
|
|
}
|
|
|
|
type SoapBodyActividad struct {
|
|
Response SincronizarResponseActividad `xml:"sincronizarActividadesResponse"`
|
|
}
|
|
|
|
type SincronizarResponseActividad struct {
|
|
RespuestaLista RespuestaListaActividades `xml:"RespuestaListaActividades"`
|
|
}
|
|
|
|
type RespuestaListaActividades struct {
|
|
Transaccion bool `xml:"transaccion"`
|
|
ListaCodigos []ListaActividades `xml:"listaActividades"`
|
|
}
|
|
|
|
type ListaActividades struct {
|
|
CodigoCaeb string `xml:"codigoCaeb,omitempty" json:"codigo,omitempty"`
|
|
Descripcion string `xml:"descripcion,omitempty" json:"descripcion,omitempty"`
|
|
TipoActividad string `xml:"tipoActividad,omitempty" json:"tipoActividad,omitempty"`
|
|
}
|
|
|
|
// Implementaciones para cada tipo de envelope
|
|
func (e SoapEnvelopeActividad) IsTransactionSuccessful() bool {
|
|
return e.Body.Response.RespuestaLista.Transaccion
|
|
}
|
|
|
|
func (e SoapEnvelopeActividad) GetData() []ListaActividades {
|
|
return e.Body.Response.RespuestaLista.ListaCodigos
|
|
}
|