Hi Aditya, I tested your API configuration with a mock backend which returns a simple JSON payload and I didn't get the mentioned error. Please find the configurations [2].
[1] { "test": "test" } [2] API: <api xmlns="http://ws.apache.org/ns/synapse" name="cacheAPI2" context="/cache2"> <resource methods="POST GET" uri-template="/headerapi2/*"> <inSequence> <log> <property name="Cache_Flow" value="Inside Cache Flow ............................."/> </log> <cache id="cache-sample" scope="per-host" collector="false" hashGenerator="org.wso2.carbon.mediator.cache.digest.REQUESTHASHGenerator" timeout="5000" maxMessageSize="100000000"> <implementation type="memory" maxSize="1000"/> </cache> <log> <property name="CacheFinder" value="After Cache Finder ******************"/> </log> <property name="uri.var.agreementId" value="1392" scope="default" type="STRING"/> <call> <endpoint key="AgreementEP"/> </call> <log description=""> <property name="Call_Mediator" value="After Call Mediator *********************"/> </log> <property name="RESPONSE" value="true" scope="default" type="STRING"/> <log level="full"> <property name="msg" value="Direct Response"/> </log> <cache scope="per-host" collector="true"/> <respond/> </inSequence> <outSequence/> <faultSequence/> </resource> </api> Endpoint: <endpoint xmlns="http://ws.apache.org/ns/synapse" name="AgreementEP"> <http uri-template="*http://www.mocky.io/v2/5ac4b2ae2f00002a00f5fb42 <http://www.mocky.io/v2/5ac4b2ae2f00002a00f5fb42>*" method="get"> <suspendOnFailure> <progressionFactor>1.0</progressionFactor> </suspendOnFailure> <markForSuspension> <retriesBeforeSuspension>0</retriesBeforeSuspension> <retryDelay>0</retryDelay> </markForSuspension> </http> </endpoint> Thanks On Wed, Apr 4, 2018 at 10:25 PM, aditya shivankar < shivankar.adit...@gmail.com> wrote: > Respected Sir/Madam, > > If you are able to store any json response into cache. Using any freely > available rest service on net. Please share me the api example. > > Thanks and Regards, > Aditya > > On Wed, Apr 4, 2018 at 10:22 PM, aditya shivankar < > shivankar.adit...@gmail.com> wrote: > >> Respected Sir/Madam, >> >> I am using wso2ei 6.1.1 . >> >> The backend service is returning a big json response of about 2000 >> lines. If I remove cache mediator both finder and collector from above >> service. I am able to receive the backend response in wso2ei api service. >> The backend response contains some "$id": "2", "$type": "A.B, C.D", some >> nested arrays etc.. >> >> With Regards, >> Aditya >> >> >> On Wed, Apr 4, 2018 at 5:15 PM, Riyafa Abdul Hameed <riy...@wso2.com> >> wrote: >> >>> This is similar to this issue[1]. Which version are you using? >>> >>> [1] https://wso2.org/jira/browse/ESBJAVA-4318 >>> >>> On Wed, Apr 4, 2018 at 5:07 PM, Thishani Lucas <thish...@wso2.com> >>> wrote: >>> >>>> Hi Aditya, >>>> >>>> Could you please elaborate more about the response sent by the backend? >>>> What kind of message type does it send? >>>> >>>> Thanks, >>>> Thishani >>>> >>>> On Wed, Apr 4, 2018 at 4:26 PM, aditya shivankar < >>>> shivankar.adit...@gmail.com> wrote: >>>> >>>>> Respected Madam, >>>>> >>>>> Tried adding "<property name="NO_ENTITY_BODY" scope="axis2" >>>>> action="remove"/>". >>>>> >>>>> But still got the same error. Plus the rest service i am using is not >>>>> returning empty response, tested it. >>>>> >>>>> <?xml version="1.0" encoding="UTF-8"?> >>>>> <api context="/cache" name="cacheAPI" xmlns="http://ws.apache.org/ns >>>>> /synapse"> >>>>> <resource methods="POST GET" uri-template="/headerapi/*"> >>>>> <inSequence> >>>>> <log> >>>>> <property name="Cache_Flow" value="Inside Cache Flow >>>>> ............................."/> >>>>> </log> >>>>> >>>>> <cache collector="false" hashGenerator="org.wso2.carbon >>>>> .mediator.cache.digest.REQUESTHASHGenerator" id="cache-sample" >>>>> maxMessageSize="100000000" scope="per-host" timeout="5000"> >>>>> <onCacheHit/> >>>>> <implementation maxSize="1000" type="memory"/> >>>>> </cache> >>>>> >>>>> <log> >>>>> <property name="CacheFinder" value="After Cache Finder >>>>> ******************"/> >>>>> </log> >>>>> <property name="uri.var.agreementId" scope="default" >>>>> type="STRING" value="1392"/> >>>>> <property name="NO_ENTITY_BODY" scope="axis2" >>>>> action="remove"/> >>>>> <call description=""> >>>>> <endpoint key="AgreementEP1"/> >>>>> </call> >>>>> <log description=""> >>>>> <property name="Call_Mediator" value="After Call >>>>> Mediator *********************"/> >>>>> </log> >>>>> <property name="RESPONSE" scope="default" type="STRING" >>>>> value="true"/> >>>>> <log level="full"> >>>>> <property name="msg" value="Direct Response"/> >>>>> </log> >>>>> >>>>> <cache collector="true" scope="per-host"/> >>>>> >>>>> <respond/> >>>>> </inSequence> >>>>> <outSequence/> >>>>> <faultSequence/> >>>>> </resource> >>>>> </api> >>>>> >>>>> With Regards, >>>>> Aditya >>>>> >>>>> >>>>> On Wed, Apr 4, 2018 at 4:16 PM, Thivya Mahenthirarasa <thi...@wso2.com >>>>> > wrote: >>>>> >>>>>> Hi Adiya, >>>>>> >>>>>> According to the logs, you are receiving 202 accepted success code, >>>>>> that means the response cached for the Endpoint might returning an >>>>>> empty body. >>>>>> >>>>>> Could you please add the following property before cache mediator in >>>>>> order to return the body from the cache to the Endpoint. >>>>>> >>>>>> >>>>>> <property name="NO_ENTITY_BODY" scope="axis2" action="remove"/> >>>>>> >>>>>> >>>>>> Try out the solution and let us know whether you could able to sort out >>>>>> the exception >>>>>> >>>>>> >>>>>> >>>>>> Regards, >>>>>> >>>>>> Thivya >>>>>> >>>>>> >>>>>> On Wed, Apr 4, 2018 at 3:58 PM, aditya shivankar < >>>>>> shivankar.adit...@gmail.com> wrote: >>>>>> >>>>>>> Respected Sir/Madam, >>>>>>> >>>>>>> Below is my api : >>>>>>> >>>>>>> <?xml version="1.0" encoding="UTF-8"?> >>>>>>> <api context="/cache" name="cacheAPI" xmlns="http://ws.apache.org/ns >>>>>>> /synapse"> >>>>>>> <resource methods="POST GET" uri-template="/headerapi/*"> >>>>>>> <inSequence> >>>>>>> <log> >>>>>>> <property name="Cache_Flow" value="Inside Cache Flow >>>>>>> ............................."/> >>>>>>> </log> >>>>>>> >>>>>>> <cache collector="false" hashGenerator="org.wso2.carbon >>>>>>> .mediator.cache.digest.REQUESTHASHGenerator" id="cache-sample" >>>>>>> maxMessageSize="100000000" scope="per-host" timeout="5000"> >>>>>>> <onCacheHit/> >>>>>>> <implementation maxSize="1000" type="memory"/> >>>>>>> </cache> >>>>>>> >>>>>>> <log> >>>>>>> <property name="CacheFinder" value="After Cache >>>>>>> Finder ******************"/> >>>>>>> </log> >>>>>>> <property name="uri.var.agreementId" scope="default" >>>>>>> type="STRING" value="1392"/> >>>>>>> <call description=""> >>>>>>> <endpoint key="AgreementEP1"/> >>>>>>> </call> >>>>>>> <log description=""> >>>>>>> <property name="Call_Mediator" value="After Call >>>>>>> Mediator *********************"/> >>>>>>> </log> >>>>>>> <property name="RESPONSE" scope="default" type="STRING" >>>>>>> value="true"/> >>>>>>> <log level="full"> >>>>>>> <property name="msg" value="Direct Response"/> >>>>>>> </log> >>>>>>> >>>>>>> <cache collector="true" scope="per-host"/> >>>>>>> >>>>>>> <respond/> >>>>>>> </inSequence> >>>>>>> <outSequence/> >>>>>>> <faultSequence/> >>>>>>> </resource> >>>>>>> </api> >>>>>>> >>>>>>> and my endpoint : >>>>>>> >>>>>>> <?xml version="1.0" encoding="UTF-8"?> >>>>>>> <endpoint name="AgreementEP1" xmlns="http://ws.apache.org/ns/synapse >>>>>>> "> >>>>>>> <http method="get" uri-template="I used my Project rest service >>>>>>> url here so did not mention"/> >>>>>>> </endpoint> >>>>>>> >>>>>>> >>>>>>> Getting below error : >>>>>>> >>>>>>> ERROR - CacheMediator Error setting response envelope from cache : >>>>>>> mediation.cache_key >>>>>>> javax.xml.soap.SOAPException: org.apache.axiom.om.OMException: SOAP >>>>>>> message MUST NOT contain Processing Instructions(PI) >>>>>>> >>>>>>> Please find logs attached. >>>>>>> >>>>>>> With Regards, >>>>>>> Aditya >>>>>>> >>>>>>> _______________________________________________ >>>>>>> Dev mailing list >>>>>>> Dev@wso2.org >>>>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> >>>>>> *Thivya Mahenthirarasa* >>>>>> >>>>>> *Software Engineer -Support Team | WSO2* >>>>>> >>>>>> >>>>>> *Email: thi...@wso2.com <thi...@wso2.com>* >>>>>> >>>>>> *Mobile: +94766461966 <http://wso2.com/signature>* >>>>>> *Web: http://wso2.com <http://wso2.com>* >>>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> Dev mailing list >>>>> Dev@wso2.org >>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev >>>>> >>>>> >>>> >>>> >>>> -- >>>> Regards, >>>> >>>> *Thishani Lucas* >>>> *Software Engineer* >>>> *WSO2 Lanka (Private) Limited**: http://wso2.com <http://wso2.com/>* >>>> *lean.enterprise.middle-ware* >>>> >>>> *Tel: +94 77 2556931 * >>>> >>>> *LinkedIn: https://www.linkedin.com/in/thishani-lucas/ >>>> <https://www.linkedin.com/in/thishani-lucas/>* >>>> >>>> <http://wso2.com/signature> >>>> >>>> _______________________________________________ >>>> Dev mailing list >>>> Dev@wso2.org >>>> http://wso2.org/cgi-bin/mailman/listinfo/dev >>>> >>>> >>> >>> >>> -- >>> Riyafa Abdul Hameed >>> Software Engineer, WSO2 Lanka (Pvt) Ltd <http://wso2.com/> >>> >>> Email: riy...@wso2.com <riyafa...@cse.mrt.ac.lk> >>> Website: https://riyafa.wordpress.com/ <http://riyafa.wordpress.com/> >>> <http://facebook.com/riyafa.ahf> <http://lk.linkedin.com/in/riyafa> >>> <http://twitter.com/Riyafa1> >>> >> >> > > _______________________________________________ > Dev mailing list > Dev@wso2.org > http://wso2.org/cgi-bin/mailman/listinfo/dev > > -- Shakila Sasikaran Software Engineer Mobile :+94 (0) 77 526 6848 shak...@wso2.com WSO2, Inc. lean . enterprise . middleware http://www.wso2.com/
_______________________________________________ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev