You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the VIES return an error message, this library return the error "service returned invalid request date".
That is not correct. It should return the error message returned by VIES.
You can correct it by changing the response structure by :
var rd struct {
XMLName xml.Name xml:"Envelope"
Soap struct {
XMLName xml.Name xml:"Body"
Soap struct {
XMLName xml.Name xml:"checkVatResponse"
CountryCode string xml:"countryCode"
VATnumber string xml:"vatNumber"
RequestDate string xml:"requestDate" // 2015-03-06+01:00
Valid bool xml:"valid"
Name string xml:"name"
Address string xml:"address"
}
And check the error after the unmarshal :
if rd.Soap.SoapFault.Message != "" {
return nil, errors.New("service returned an error : " + rd.Soap.SoapFault.Message)
}
The text was updated successfully, but these errors were encountered:
When the VIES return an error message, this library return the error "service returned invalid request date".
That is not correct. It should return the error message returned by VIES.
You can correct it by changing the response structure by :
var rd struct {
XMLName xml.Name
xml:"Envelope"
Soap struct {
XMLName xml.Name
xml:"Body"
Soap struct {
XMLName xml.Name
xml:"checkVatResponse"
CountryCode string
xml:"countryCode"
VATnumber string
xml:"vatNumber"
RequestDate string
xml:"requestDate"
// 2015-03-06+01:00Valid bool
xml:"valid"
Name string
xml:"name"
Address string
xml:"address"
}
And check the error after the unmarshal :
if rd.Soap.SoapFault.Message != "" {
return nil, errors.New("service returned an error : " + rd.Soap.SoapFault.Message)
}
The text was updated successfully, but these errors were encountered: