如何在定义中的 azure api 策略中设置响应代码 500

问题描述

如何在定义中的 azure api 策略中设置响应代码 500。

我想处理 API 管理的出站策略中的soap错误

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>5</faultcode>
<faultstring>Session expired. Try to relogin.</faultstring>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

解决方法

你可以像这样用 500 设置响应代码:

enter image description here