【问题标题】:how to set response code 500 in azure api policy in definition如何在定义中的 azure api 策略中设置响应代码 500
【发布时间】:2021-05-18 14:28:10
【问题描述】:

如何在定义中的 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>

【问题讨论】:

    标签: azure-api-management outbound


    【解决方案1】:

    您可以这样设置响应代码为 500:

    【讨论】:

    • 感谢您的回复。但即使我添加了这个,我也得到了 200 个响应代码。我确实喜欢这个结果显示为 HTTP/1.1 200 OK content-type: text/xml; charset=UTF-8 日期:2021 年 5 月 20 日星期四 07:53:50 GMT 到期:1981 年 11 月 19 日星期四 08:52:00 GMT w3.org/1999/XSL/Format" xmlns:ns1="urn :Magento"> text/plain
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-01-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多