Return 200 HTTP 代码一火就忘了 API
Return 200 HTTP code in a fire and forget API
我正在尝试创建一个 public "fire&forget" API,目前 return 是一个 200 OK HTTP
代码。
根据WSO2 ESB documentation for 202 Accepted,我必须在FORCE_SC_ACCEPTED 属性 中设置为true。
不过,我不想return202,我要return200.
是否可以使用其他 属性 在 "fire&forget" API 中强制使用 return 200?
设置 http 状态代码:
<property name="HTTP_SC" value="200" scope="axis2"/>
生成一条空消息:
<enrich>
<source type="inline">
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<soapenv:Header/>
<soapenv:Body/>
</soapenv:Envelope>
</source>
<target type="envelope"/>
</enrich>
设置消息类型以选择适当的消息格式化程序(soap12 示例):
<property name="messageType" scope="axis2" value="application/soap+xml"/>
将其作为响应消息发回:
<header name="To" action="remove"/>
<property name="RESPONSE" value="true" scope="default" type="STRING"/>
<property name="NO_ENTITY_BODY" scope="axis2" action="remove"/>
<send/>
我正在尝试创建一个 public "fire&forget" API,目前 return 是一个 200 OK HTTP
代码。
根据WSO2 ESB documentation for 202 Accepted,我必须在FORCE_SC_ACCEPTED 属性 中设置为true。 不过,我不想return202,我要return200.
是否可以使用其他 属性 在 "fire&forget" API 中强制使用 return 200?
设置 http 状态代码:
<property name="HTTP_SC" value="200" scope="axis2"/>
生成一条空消息:
<enrich>
<source type="inline">
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<soapenv:Header/>
<soapenv:Body/>
</soapenv:Envelope>
</source>
<target type="envelope"/>
</enrich>
设置消息类型以选择适当的消息格式化程序(soap12 示例):
<property name="messageType" scope="axis2" value="application/soap+xml"/>
将其作为响应消息发回:
<header name="To" action="remove"/>
<property name="RESPONSE" value="true" scope="default" type="STRING"/>
<property name="NO_ENTITY_BODY" scope="axis2" action="remove"/>
<send/>