axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Deepal jayasinghe <deep...@gmail.com>
Subject Re: How to terminate InFlow and start OutFlow in the custom handler of axis2
Date Wed, 13 May 2009 14:52:37 GMT
Try this,

MessageContext faultContext =                                
MessageContextBuilder.createFaultMessageContext(messageCtx, e);
AxisEngine.sendFault(faultContext);

- Deepal
> Hi Deepal,
>
>    Thanks for your reply. If we set the AxisEngine.sendFault(msgContext) in
> inflow handler, it will execute the outFaultFlow but client program wotn get
> any response and we are getting org.apache.axis2.AxisFault: Read timed out
> exception. And its again and again executing the inflow handler. For testing
> purpose i have written 
> 	if(msgContext.getFLOW()==1)
>         {
>         	 logger.info("This is inFlow");
> }
>  in the inFlowhandler class and its getting execute again and again. But i
> want it should get execute only once when request comes from client and it
> should do validation of that request message, if something is wrong then
> outflow or OutFaultFlow should get execute and send the proper error
> response to client and should get terminate there only. Once we get any
> validation error in inFlow handler, it should not process further engaged
> module and request should terminate in inFlow and from there client should
> get response via outFlow or outFaultFlow.
>
>    We are engaging the sandesha and rampart from in the client program only.
>
> 			sender.engageModule("addressing"); 
> 			sender.engageModule("sandesha2");
> 			options.setProperty(SandeshaClientConstants.OFFERED_SEQUENCE_ID,
> "Yash_Seq");
> 			sender.engageModule("rampart");
> 		
> 			options.setProperty(RampartMessageData.KEY_RAMPART_POLICY,  			
> loadPolicy("C:/WS-X/misc/20090427/WTPTestRM2Client/WebContent/WEB-INF/conf/policy.xml"));
>
> Could you please let us know how to achieve this functionality. 
>
> Thanks,
> Swapna Soni.
>
> Deepal Jayasinghe-2 wrote:
>   
>> Behavior will be different based on the dispatch status, but you can
>> simply call.
>>
>> AxisEngine.sendFault(messageContext)
>>
>> Then it will send  the fault
>>
>> -  Deepal
>>     
>>> Hi Axis Team,
>>>
>>>     I have one very urgent requirement. One client program invokes the
>>> service in which sandesha, rampart and one custom module is engaged. In
>>> custom Inflow handler we do some validation. If something is wrong in
>>> that
>>> validation, then we want it to start the outFlow and send the custom
>>> response to client back without executing further engaged modules and
>>> without invoking service. 
>>>
>>>    Could anyone please tell me how can i do this using axis2 api. Its
>>> very
>>> very urgent requirement for us. 
>>>
>>> Thanks,
>>> swapna soni
>>>   
>>>       
>> -- 
>> Thank you!
>>
>>
>> http://blogs.deepal.org
>> http://deepal.org
>>
>>
>>
>>     
>
>   


-- 
Thank you!


http://blogs.deepal.org
http://deepal.org


Mime
View raw message