使用Enterprise Integrator 6.6.0时,如果应用程序接口的inSequence发生某种错误,如何调用错误序列?
例如,我希望将$url参数解析为整数,但如果它不是可解析的整数,则在控制台中只能得到一个错误
[2021-08-05 10:00:46,669] ERROR {PropertyMediator} - Unknown type : INTEGER for the property mediator or the property value cannot be converted into the specified type. java.lang.NumberFormatException: For input string: "780jk"但客户还是会得到200分
发布于 2021-08-05 10:34:14
在您的api资源定义中,是否包含了faultSequence元素?
<api name="API_NAME" context="URI_PATH_OF_API" [hostname="HOST_NAME_OF_SERVER"] [port="PORT_NUMBER"]>
<resource [methods="GET|POST|PUT|DELETE|OPTIONS|HEAD|PATCH"] [uri-template="URI_TEMPLATE"|url-mapping="URL_MAPPING"]>
<inSequence>
...
</inSequence>?
<outSequence>
...
</outSequence>?
<faultSequence>
...
</faultSequence>?
</resource>
</api>您可以查看有关它的更多信息here
在这个错误序列中,您可以将您选择的HTTP代码或消息返回给客户端。
<property=HTTP_SC" scope="axis2" value="404" type="string"/>
<respond/>https://stackoverflow.com/questions/68662922
复制相似问题