importResource overide not working properly in Handler

beginnersmind's picture
Hi The issue is adding some properties to policy and wsdl files at the time of import. The handler config is attached The handler is getting called but the resource content is null. //content below is null. Resource resource = requestContext.getResource(); System.out.println(resource.getContent()) I tried through the path /policy.xml and /governance/policies/policy.xml with same result. I understand that a system handler(PolicyMediaTypeHandler) configured in registry.xml is interfering is there a way around??? Bye the way I forgot to add that it works perfectly for put.but then the web client would have to first import and then open the content and save for the put to take effect thanks in advance. Mohit
AttachmentSize
1.xml262 bytes
senakafdo's picture

Re: importResource overide not working properly in Handler

Hi Mohit, Yes, this is due to the system handler interfering with yours. We have identified this limitation and have started working on a model where we breakdown handlers into several phases, allowing mandatory system handlers to run first, along with optional system handlers and user-defined handlers to run in the next few phases, followed by status reporting and notification system handlers running in the last phase. This improvement will be available from the next major release. For the moment, the best workaround I can think of is for you to extend the PolicyMediaTypeHandler handler and implement yours. Then, in the registry.xml, replace the configuration for the PolicyMediaTypeHandler with yours. You can then appropriately implement the methods you want to change and leave the rest as it is. HTH. Thanks, Senaka
library project main code
Learn Cloud
Learn
Cloud

The WSO2 Application Server is a reliable application server that can host your enterprise web applications. The WSO2 Application Server as a Service is offered in StratosLive, the WSO2 Platform as a Service. This article explains how a simple web application can be developed and deployed from Carbon Studio to the WSO2 Application Server...

Latest Webinar
Different groups within an organization need to monitor different Key Performance Indicators (KPIs) - An operations team will be interested in the response times of business services and loads of each service,..
Thursday, February 9th 2012, 09.00 AM (PST)

Thursday, February 9th 2012, 10.00 AM (GMT)