parent
6121890ebc
commit
d37d73fe36
@ -0,0 +1,41 @@
|
|||||||
|
<sequence xmlns="http://ws.apache.org/ns/synapse" name="json_fault">
|
||||||
|
<log level="custom">
|
||||||
|
<property name="STATUS" value="Executing custom 'fault' sequence"/>
|
||||||
|
<property name="ERROR_CODE" expression="get-property('ERROR_CODE')"/>
|
||||||
|
<property name="ERROR_MESSAGE" expression="get-property('ERROR_MESSAGE')"/>
|
||||||
|
</log>
|
||||||
|
<payloadFactory>
|
||||||
|
<format>
|
||||||
|
<am:fault xmlns:am="http://wso2.org/apimanager">
|
||||||
|
<am:code>$1</am:code>
|
||||||
|
<am:type>Status report</am:type>
|
||||||
|
<am:message>Runtime Error</am:message>
|
||||||
|
<am:description>$2</am:description>
|
||||||
|
</am:fault>
|
||||||
|
</format>
|
||||||
|
<args>
|
||||||
|
<arg expression="$ctx:ERROR_CODE"/>
|
||||||
|
<arg expression="$ctx:ERROR_MESSAGE"/>
|
||||||
|
</args>
|
||||||
|
</payloadFactory>
|
||||||
|
<filter xpath="$ctx:CUSTOM_HTTP_SC">
|
||||||
|
<then>
|
||||||
|
<property name="HTTP_SC" expression="$ctx:CUSTOM_HTTP_SC" scope="axis2"/>
|
||||||
|
</then>
|
||||||
|
<else>
|
||||||
|
<property name="HTTP_SC" value="500" scope="axis2"/>
|
||||||
|
</else>
|
||||||
|
</filter>
|
||||||
|
<class name="org.wso2.carbon.apimgt.usage.publisher.APIMgtFaultHandler"/>
|
||||||
|
<property name="RESPONSE" value="true"/>
|
||||||
|
<header name="To" action="remove"/>
|
||||||
|
<property name="NO_ENTITY_BODY" scope="axis2" action="remove"/>
|
||||||
|
<property name="ContentType" scope="axis2" action="remove"/>
|
||||||
|
<property name="Authorization" scope="transport" action="remove"/>
|
||||||
|
<property name="Host" scope="transport" action="remove"/>
|
||||||
|
<property name="Accept" scope="transport" action="remove"/>
|
||||||
|
<property name="X-JWT-Assertion" scope="transport" action="remove"/>
|
||||||
|
<property name="messageType" value="application/json" scope="axis2"/>
|
||||||
|
<send/>
|
||||||
|
<drop/>
|
||||||
|
</sequence>
|
@ -0,0 +1,3 @@
|
|||||||
|
<sequence xmlns="http://ws.apache.org/ns/synapse" name="json_to_xml_in_message">
|
||||||
|
<property name="messageType" value="application/xml" scope="axis2"/>
|
||||||
|
</sequence>
|
@ -0,0 +1,5 @@
|
|||||||
|
<sequence xmlns="http://ws.apache.org/ns/synapse" name="log_in_message">
|
||||||
|
<log level="full">
|
||||||
|
<property name="IN_MESSAGE" value="IN_MESSAGE"/>
|
||||||
|
</log>
|
||||||
|
</sequence>
|
@ -0,0 +1,4 @@
|
|||||||
|
<sequence xmlns="http://ws.apache.org/ns/synapse" name="preserve_accept_header">
|
||||||
|
<property name="WSO2_AM_API_ACCEPT_MESSAGE_TYPE" expression="get-property('transport', 'Accept')" scope="default"/>
|
||||||
|
<property name="Accept" scope="transport" action="remove"/>
|
||||||
|
</sequence>
|
@ -0,0 +1,3 @@
|
|||||||
|
<sequence xmlns="http://ws.apache.org/ns/synapse" name="xml_to_json_in_message">
|
||||||
|
<property name="messageType" value="application/json" scope="axis2"/>
|
||||||
|
</sequence>
|
@ -0,0 +1,5 @@
|
|||||||
|
<sequence xmlns="http://ws.apache.org/ns/synapse" name="apply_accept_header">
|
||||||
|
<property name="messageType"
|
||||||
|
expression="get-property('default', 'WSO2_AM_API_ACCEPT_MESSAGE_TYPE')"
|
||||||
|
scope="axis2"/>
|
||||||
|
</sequence>
|
@ -0,0 +1,3 @@
|
|||||||
|
<sequence xmlns="http://ws.apache.org/ns/synapse" name="json_to_xml_out_message">
|
||||||
|
<property name="messageType" value="application/xml" scope="axis2"/>
|
||||||
|
</sequence>
|
@ -0,0 +1,5 @@
|
|||||||
|
<sequence xmlns="http://ws.apache.org/ns/synapse" name="log_out_message">
|
||||||
|
<log level="full">
|
||||||
|
<property name="OUT_MESSAGE" value="OUT_MESSAGE"/>
|
||||||
|
</log>
|
||||||
|
</sequence>
|
@ -0,0 +1,3 @@
|
|||||||
|
<sequence xmlns="http://ws.apache.org/ns/synapse" name="xml_to_json_out_message">
|
||||||
|
<property name="messageType" value="application/json" scope="axis2"/>
|
||||||
|
</sequence>
|
Loading…
Reference in new issue