Hi Priyadarshani,

You have to build the message inside the handleRequest method then you can
get the message body. Please refer [1] for building the message and refer
[2] for getting the requestBody.

[1]
https://github.com/wso2/carbon-apimgt/blob/master/components/apimgt/org.wso2.carbon.apimgt.gateway/src/main/java/org/wso2/carbon/apimgt/gateway/handlers/security/SchemaValidator.java#L97
[2]
https://github.com/wso2/carbon-apimgt/blob/master/components/apimgt/org.wso2.carbon.apimgt.gateway/src/main/java/org/wso2/carbon/apimgt/gateway/handlers/security/SchemaValidator.java#L236


Regards,
Hasunie


On Tue, Nov 12, 2019 at 3:40 PM Pasindu Jayaweera <[email protected]> wrote:

> Hi Priyadarshini,
>
> For the  handleRequest method of the customer handler you will be
> receiving the messageContext as below;
>
> public boolean handleRequest(MessageContext messageContext)
>
>
> This messageContext has a method as *getEnvelope* [1] which will give you
> the message (including header and body).
>
> [1] -
> https://github.com/wso2/wso2-synapse/blob/master/modules/core/src/main/java/org/apache/synapse/MessageContext.java#L193
>
>
> Regards,
>
> On Mon, Nov 11, 2019 at 5:16 PM Priyadarshini Punjabi <
> [email protected]> wrote:
>
>> Hii,
>>
>> how to read request body in custom handler wso2.
>>
>> Thanks
>> _______________________________________________
>> Dev mailing list
>> [email protected]
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>
>
> --
> *Pasindu Jayaweera *| Senior Software Engineer | WSO2 Inc
> Mobile: +94 711555785 | Blog: blog.pasindujayaweera.com
> <http://wso2.com/signature>
> _______________________________________________
> Dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>


-- 
*Hasunie Adikari*
Associate Technical Lead
WSO2 Inc.; http://wso2.com
lean.enterprise.middleware
blog http://hasuniea.blogspot.com | https://medium.com/@Hasunie/
Mobile:+94713095876
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to