Dynamic error messages webservice responses
Description
Environment
Activity
Diego Ruiz August 22, 2020 at 5:28 PM
Triaged by Diego Ruiz,
Closing the ticket as a potential idea due to a lack of interest from the community in 5 years
Saúl Piña April 29, 2015 at 2:23 PM
Example approach:
Msg.getMsg(language.getAD_Language(), "FailedLogin");
Saúl Piña April 29, 2015 at 2:21 PM
Example request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:_0="http://idempiere.org/ADInterface/1_0">
<soapenv:Header/>
<soapenv:Body>
<_0:queryData>
<_0:ModelCRUDRequest>
<_0:ModelCRUD>
<_0:serviceType>getUser</_0:serviceType>
<_0😃ataRow>
<_0:field column="Name">
<_0:val>%Gar%</_0:val>
</_0:field>
</_0😃ataRow>
</_0:ModelCRUD>
<_0:ADLoginRequest>
<_0:user>NOUSER</_0:user>
<_0😛ass>NOUSER</_0😛ass>
<_0:lang>es_CO</_0:lang>
<_0:ClientID>11</_0:ClientID>
<_0:RoleID>50004</_0:RoleID>
</_0:ADLoginRequest>
</_0:ModelCRUDRequest>
</_0:queryData>
</soapenv:Body>
</soapenv:Envelope>
Example response:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns1:queryDataResponse xmlns:ns1="http://idempiere.org/ADInterface/1_0">
<WindowTabData xmlns="http://idempiere.org/ADInterface/1_0">
<Error>Error login - User invalid</Error>
</WindowTabData>
</ns1:queryDataResponse>
</soap:Body>
</soap:Envelope>
Desired response for es_CO:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns1:queryDataResponse xmlns:ns1="http://idempiere.org/ADInterface/1_0">
<WindowTabData xmlns="http://idempiere.org/ADInterface/1_0">
<Error>Usuario o Contraseña no válidos</Error>
</WindowTabData>
</ns1:queryDataResponse>
</soap:Body>
</soap:Envelope>
Currently when an error is generated, the web service respond to static messages. It is proposed to respond using AD_Message table. In addition, the answer will be translated to the language specified in the request ADLoginRequest