【发布时间】:2019-06-28 03:02:53
【问题描述】:
使用 WSO2 EI(6.5.0) DataService 时如何返回自定义错误响应
验证输入值时出现此错误:
{
"Fault": {
"faultcode": "axis2ns16:VALIDATION_ERROR",
"faultstring": "DS Code: VALIDATION_ERROR\nNested Exception:-\njavax.xml.stream.XMLStreamException: DS Code: VALIDATION_ERROR\nSource Data Service:-\nName: MWGetBranchCodes\nLocation: \\MWGetBranchCodes.dbs\nDescription: N/A\nDefault Namespace: http://ws.wso2.org/dataservice\nCurrent Request Name: _post_getbankcodes\nCurrent Params: {SOURCE=source, REQUESTER=bond, FUNCTION=function, SECURITYCODE=1FE550839D5DD7933032340DA85F614}\nNested Exception:-\nSecuritycode and Function are not matched : \nField Name: SECURITYCODE\nField Value: 1FE550839D5DD7933032340DA85F614\n\n",
"detail": ""
}
}
我想要这个:
{
"Error": {
"ErrorCode": "0", 0-failed/ 1-success
"ErrorMessage": "VALIDATION_ERROR : Securitycode is NULL",
"detail": " \nField Name: SECURITYCODE\nField Value: null\n\n"
}
}
请帮帮我,谢谢。
【问题讨论】:
标签: wso2 wso2is wso2-am wso2dss wso2ei