title: WSO2APIM Message Mediation - API call blocked
body: <p>I am trying to test out XACML policies defined in WSO2 IS through WSO2 API Manager, as explained in the following link</p>
  
  <p><a href="https://docs.wso2.com/display/AM210/Enabling+Role-Based+Access+Control+Using+XACML" rel="nofollow noreferrer">https://docs.wso2.com/display/AM210/Enabling+Role-Based+Access+Control+Using+XACML</a></p>
  
  <p>The policy is getting validated and I can see the "Permit" decision in the logs, but the API manager doesn't returns any response and the call is blocked and the request gets timed out after some time.</p>
  
  <pre><code>    DEBUG - EntitlementMediator Entitlement Decision is : Permit
      DEBUG - EntitlementMediator User is authorized to perform the action
      DEBUG - EntitlementMediator OnAccept sequence is not defined.
      INFO - SourceHandler Writer null when calling informWriterError
      WARN - SourceHandler Connection time out after request is read: http-incoming-19 Socket Timeout : 60000 Remote Address : /0:0:0:0:0:0:0:1:63398
      WARN - TimeoutHandler Expiring message ID : urn:uuid:045f7259-cc8b-46a7-b9a2-832429163531; dropping message after GLOBAL_TIMEOUT of : 120 seconds for Endpoint 
  </code></pre>
  
  <p>Pasting the message mediation policy file</p>
  
  <pre><code>            &lt;sequence xmlns="http://ws.apache.org/ns/synapse"  name="EM"&gt;     &lt;entitlementService xmlns="http://ws.apache.org/ns/synapse" remoteServiceUrl="https://localhost:9443/services" remoteServiceUserName="admin" remoteServicePassword="admin" callbackClass="org.wso2.sample.handlers.entitlement.APIEntitlementCallbackHandler"&gt;
                                              &lt;onReject&gt;
                                                              &lt;makefault version="soap12"&gt;
                                                                              &lt;code xmlns:soap12Env="http://www.w3.org/2003/05/soap-envelope"
                                                                                              value="soap12Env:Receiver"/&gt;
                                                                              &lt;reason value="UNAUTHORIZED"/&gt;
                                                                              &lt;node/&gt;
                                                                              &lt;role/&gt;
                                                                              &lt;detail&gt;XACML Authorization Failed&lt;/detail&gt;
                                                              &lt;/makefault&gt;
                                                              &lt;respond/&gt;
                                              &lt;/onReject&gt;
                                              &lt;onAccept&gt;
                                              &lt;log level="trace" xmlns="http://ws.apache.org/ns/synapse"/&gt;
                                                              &lt;send&gt;
                                                                              &lt;endpoint&gt;
                                                                                              &lt;address uri="http://localhost:8080"/&gt;
                                                                              &lt;/endpoint&gt;
                                                              &lt;/send&gt;
                                              &lt;/onAccept&gt;
                                              &lt;obligations/&gt;
                                              &lt;advice/&gt;
                              &lt;/entitlementService&gt;
              &lt;/sequence&gt;
  </code></pre>
  
  <p>If I just use respond in OnAccept, instead of send, the call returns immediately, but my back end API doesn't get called.</p>
  
  <p>Am I missing something here ?</p>
  
  <p>Thanks,  Albie Morken</p>