Hi All,

I have created an API in wso2 ESB 5.0.0  to call the SOAP back-end service.
I have used cache mediator for a normal GET method.  What I want is, I have
used a GET Method to get some details, I passed the id with the URL.

Requirement- When I call the service through API for a given id in the
first time I need a proper response for particular id, then for next call
for the same id it should get the response from the cache itself up-to-the
given Timeout period. if I change the id then it should hit the service.

I attached my configuration.

<api xmlns="http://ws.apache.org/ns/synapse"; name="Durdan" context="/test">
 <resource methods="GET" uri-template="/{+patientId}">
      <inSequence>
         <property name="SymboValue"
expression="get-property('uri.var.patientId)"/>
         <cache id="someCache" scope="per-host" collector="false"
hashGenerator="org.wso2.carbon.mediator.cache.digest.REQUESTHASHGenerator"
timeout="60">
        <implementation type="memory" maxSize="10"/>
     </cache>
                     <log>
                  <property name="88888888888888" value="out the sequence"/>
               </log>
               <payloadFactory media-type="xml">
                  <format>
                     <soapenv:Envelope xmlns:soapenv="
http://schemas.xmlsoap.org/soap/envelope/";>
                        <soapenv:Header>
                           <some>12</some>
                        </soapenv:Header>
                        <soapenv:Body>
                           <ser:readMediData xmlns:ser="
http://service.sample.durdans.com";>
                              <ser:patientId>$1</ser:patientId>
                           </ser:readMediData>
                        </soapenv:Body>
                     </soapenv:Envelope>
                  </format>
                  <args>
                     <arg evaluator="xml"
expression="get-property('uri.var.patientId')"/>
                  </args>
               </payloadFactory>
         <header name="Action" value="urn:readMediDataRecords"/>
         <property name="SOAPAction" value="urn:readMediData"
scope="transport"/>
         <send>
            <endpoint>
               <address uri="Endpoint URL" format="soap11"/>
            </endpoint>
         </send>
      </inSequence>
      <outSequence>
        <cache id="someCache" scope="per-host" collector="true"/>
         <send/>
      </outSequence>
   </resource>
</api>


Above configuration, I was able to get the response for proper id. but
cache mediator is not working.


Can anyone help me to solve this??

Thanks in advance.
-- 


*Best Regards,Dilusha Alphonso*

*Software Engineer - Support Team*


*WSO2*
*Mobile : *

*+94766837098[image: http://wso2.com/signature] <http://wso2.com/signature>*
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to