You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Deepak Vishwakarma <vd...@yahoo.co.in> on 2008/01/10 13:53:04 UTC

Axis2 Writing Custom Phase Handlers

Hi,

  I am using IBM Websphere Application Server and Web Service Feature Pack version 6.1. I want to write a custom handler which I have to inject it in Axis2 Soap Engine Phases. I could get some material but they were not helpful enough since i don't want to use the module approach, i just need to write a plain handler.

  It would be very helpful if i can get some pointers and concrete information on how to achieve this with respect to websphere.

  Thanks in advance for your help.

Deepak.

       
---------------------------------
 Now you can chat without downloading messenger. Click here to know how.

Re: Axis2 Writing Custom Phase Handlers

Posted by Deepak Vishwakarma <vd...@yahoo.co.in>.
Using the module approach will my handler receive the SOAP request for any web service deployed under Websphere? If the answer is yes then i can go with the module approach, but would need help implementing the module with respect to Websphere.

Michele Mazzucco <Mi...@ncl.ac.uk> wrote: 
On 11 Jan 2008, at 04:13, Deepak Vishwakarma wrote:

> So, does this means that i have to programmatically register the  
> handler in Websphere and can't use the Axis standard way of  
> configuring it in the axis2.xml configuration file.

Yes, you can. However in your first email you said you "don't want to  
use the module approach", right?
>
>
> I will try to find out if websphere provides some native api's to  
> get the axis configuration at runtime.
>
> Thanks for your help.
>
> Michele Mazzucco  wrote: Deepak,
>
> if you can get a reference to the configuration context you can do
> something like this:
>
>
> AxisService service = Utils.createSimpleService(new QName("EchoXml"),
> new RawXMLINOutMessageReceiver(), EchoXML.class.getName(),
> new QName("echo"));
> service.setScope(Constants.SCOPE_REQUEST);
> // service.setEnableAllTransports(true);
>
> final AxisConfiguration axisConfiguration = this.configurationContext
> .getAxisConfiguration();
> axisConfiguration.addService(service);
>
> HandlerDescription description = new HandlerDescription("MyHandler");
> description.setHandler(new MyHandler());
> ArrayList phasesList = axisConfiguration.getOutFlowPhases();
>
> Phase myPhase = new Phase("MyPhase");
> myPhase.addHandler(description);
>
> phasesList.add(0, myPhase);
> axisConfiguration.setOutFaultPhases(phasesList);
>
>
> HTH,
> Michele
>
>
> On 10 Jan 2008, at 12:53, Deepak Vishwakarma wrote:
>
> > Hi,
> >
> > I am using IBM Websphere Application Server and Web Service
> > Feature Pack version 6.1. I want to write a custom handler which I
> > have to inject it in Axis2 Soap Engine Phases. I could get some
> > material but they were not helpful enough since i don't want to use
> > the module approach, i just need to write a plain handler.
> >
> > It would be very helpful if i can get some pointers and concrete
> > information on how to achieve this with respect to websphere.
> >
> > Thanks in advance for your help.
> >
> > Deepak.
> > Now you can chat without downloading messenger. Click here to know
> > how.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
> Now you can chat without downloading messenger. Click here to know  
> how.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org



       
---------------------------------
 Save all your chat conversations. Find them online.

Re: Axis2 Writing Custom Phase Handlers

Posted by Michele Mazzucco <Mi...@ncl.ac.uk>.
On 11 Jan 2008, at 04:13, Deepak Vishwakarma wrote:

> So, does this means that i have to programmatically register the  
> handler in Websphere and can't use the Axis standard way of  
> configuring it in the axis2.xml configuration file.

Yes, you can. However in your first email you said you "don't want to  
use the module approach", right?
>
>
> I will try to find out if websphere provides some native api's to  
> get the axis configuration at runtime.
>
> Thanks for your help.
>
> Michele Mazzucco <Mi...@ncl.ac.uk> wrote: Deepak,
>
> if you can get a reference to the configuration context you can do
> something like this:
>
>
> AxisService service = Utils.createSimpleService(new QName("EchoXml"),
> new RawXMLINOutMessageReceiver(), EchoXML.class.getName(),
> new QName("echo"));
> service.setScope(Constants.SCOPE_REQUEST);
> // service.setEnableAllTransports(true);
>
> final AxisConfiguration axisConfiguration = this.configurationContext
> .getAxisConfiguration();
> axisConfiguration.addService(service);
>
> HandlerDescription description = new HandlerDescription("MyHandler");
> description.setHandler(new MyHandler());
> ArrayList phasesList = axisConfiguration.getOutFlowPhases();
>
> Phase myPhase = new Phase("MyPhase");
> myPhase.addHandler(description);
>
> phasesList.add(0, myPhase);
> axisConfiguration.setOutFaultPhases(phasesList);
>
>
> HTH,
> Michele
>
>
> On 10 Jan 2008, at 12:53, Deepak Vishwakarma wrote:
>
> > Hi,
> >
> > I am using IBM Websphere Application Server and Web Service
> > Feature Pack version 6.1. I want to write a custom handler which I
> > have to inject it in Axis2 Soap Engine Phases. I could get some
> > material but they were not helpful enough since i don't want to use
> > the module approach, i just need to write a plain handler.
> >
> > It would be very helpful if i can get some pointers and concrete
> > information on how to achieve this with respect to websphere.
> >
> > Thanks in advance for your help.
> >
> > Deepak.
> > Now you can chat without downloading messenger. Click here to know
> > how.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
> Now you can chat without downloading messenger. Click here to know  
> how.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Axis2 Writing Custom Phase Handlers

Posted by Deepak Vishwakarma <vd...@yahoo.co.in>.
So, does this means that i have to programmatically register the handler in Websphere and can't use the Axis standard way of configuring it in the axis2.xml configuration file.

I will try to find out if websphere provides some native api's to get the axis configuration at runtime.

Thanks for your help.

Michele Mazzucco <Mi...@ncl.ac.uk> wrote: Deepak,

if you can get a reference to the configuration context you can do  
something like this:


AxisService service = Utils.createSimpleService(new QName("EchoXml"),
    new RawXMLINOutMessageReceiver(), EchoXML.class.getName(),
    new QName("echo"));
  service.setScope(Constants.SCOPE_REQUEST);
  // service.setEnableAllTransports(true);

  final AxisConfiguration axisConfiguration = this.configurationContext
    .getAxisConfiguration();
  axisConfiguration.addService(service);

  HandlerDescription description = new HandlerDescription("MyHandler");
  description.setHandler(new MyHandler());
  ArrayList
 phasesList = axisConfiguration.getOutFlowPhases();

  Phase myPhase = new Phase("MyPhase");
  myPhase.addHandler(description);

  phasesList.add(0, myPhase);
  axisConfiguration.setOutFaultPhases(phasesList);


HTH,
Michele


On 10 Jan 2008, at 12:53, Deepak Vishwakarma wrote:

> Hi,
>
>   I am using IBM Websphere Application Server and Web Service  
> Feature Pack version 6.1. I want to write a custom handler which I  
> have to inject it in Axis2 Soap Engine Phases. I could get some  
> material but they were not helpful enough since i don't want to use  
> the module approach, i just need to write a plain handler.
>
>   It would be very helpful if i can get some pointers and concrete  
> information on how to achieve this with respect to websphere.
>
>   Thanks in advance for your help.
>
> Deepak.
> Now you can chat without downloading messenger. Click here to know  
> how.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org




       
---------------------------------
 Now you can chat without downloading messenger. Click here to know how.

Re: Axis2 Writing Custom Phase Handlers

Posted by Michele Mazzucco <Mi...@ncl.ac.uk>.
Deepak,

if you can get a reference to the configuration context you can do  
something like this:


AxisService service = Utils.createSimpleService(new QName("EchoXml"),
				new RawXMLINOutMessageReceiver(), EchoXML.class.getName(),
				new QName("echo"));
		service.setScope(Constants.SCOPE_REQUEST);
		// service.setEnableAllTransports(true);

		final AxisConfiguration axisConfiguration = this.configurationContext
				.getAxisConfiguration();
		axisConfiguration.addService(service);

		HandlerDescription description = new HandlerDescription("MyHandler");
		description.setHandler(new MyHandler());
		ArrayList<Phase> phasesList = axisConfiguration.getOutFlowPhases();

		Phase myPhase = new Phase("MyPhase");
		myPhase.addHandler(description);

		phasesList.add(0, myPhase);
		axisConfiguration.setOutFaultPhases(phasesList);


HTH,
Michele


On 10 Jan 2008, at 12:53, Deepak Vishwakarma wrote:

> Hi,
>
>   I am using IBM Websphere Application Server and Web Service  
> Feature Pack version 6.1. I want to write a custom handler which I  
> have to inject it in Axis2 Soap Engine Phases. I could get some  
> material but they were not helpful enough since i don't want to use  
> the module approach, i just need to write a plain handler.
>
>   It would be very helpful if i can get some pointers and concrete  
> information on how to achieve this with respect to websphere.
>
>   Thanks in advance for your help.
>
> Deepak.
> Now you can chat without downloading messenger. Click here to know  
> how.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Axis2 Writing Custom Phase Handlers

Posted by Martin Gainty <mg...@hotmail.com>.
You can use org.apache.axis2.dispatchers.AddressingBasedDispatcher.java as a model

then in axis2.xml configure the handler as in
<handler name="AddressingBasedDispatcher" class="org.apache.axis2.dispatchers.AddressingBasedDispatcher"/>

where the handler is configured into the engine as a Phase as in this example
<phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">

which is then configured in phaseOrder of InFault,OutFault,InFaultFlow or OutFaultFlow

HTH/
M--
  ----- Original Message ----- 
  From: Deepak Vishwakarma 
  To: axis-dev@ws.apache.org ; axis-user@ws.apache.org 
  Sent: Thursday, January 10, 2008 7:53 AM
  Subject: Axis2 Writing Custom Phase Handlers


  Hi,

    I am using IBM Websphere Application Server and Web Service Feature Pack version 6.1. I want to write a custom handler which I have to inject it in Axis2 Soap Engine Phases. I could get some material but they were not helpful enough since i don't want to use the module approach, i just need to write a plain handler.

    It would be very helpful if i can get some pointers and concrete information on how to achieve this with respect to websphere.

    Thanks in advance for your help.

  Deepak.



------------------------------------------------------------------------------
  Now you can chat without downloading messenger. Click here to know how.

Re: Axis2 Writing Custom Phase Handlers

Posted by David Illsley <da...@gmail.com>.
Deepak,
I'd suggest that you ask this on the IBM developerworks forum for the
web services feature pack [1]. I seem to remember that adding Axis2
modules/handlers isn't supported for the feature pack, and that
instead, JAX-WS Handers is the supported mechanism to add handlers,
though that is simply a recollection. If JAX-WS handlers don't support
what you need, you should get in touch with IBM service to confirm
what I've said.
Cheers,
David

[1] http://www-128.ibm.com/developerworks/forums/forum.jspa?forumID=955

On Jan 10, 2008 12:53 PM, Deepak Vishwakarma <vd...@yahoo.co.in> wrote:
> Hi,
>
>   I am using IBM Websphere Application Server and Web Service Feature Pack
> version 6.1. I want to write a custom handler which I have to inject it in
> Axis2 Soap Engine Phases. I could get some material but they were not
> helpful enough since i don't want to use the module approach, i just need to
> write a plain handler.
>
>   It would be very helpful if i can get some pointers and concrete
> information on how to achieve this with respect to websphere.
>
>   Thanks in advance for your help.
>
> Deepak.
>
>
>  ________________________________
>  Now you can chat without downloading messenger. Click here to know how.

-- 
David Illsley - IBM Web Services Development (but speaking only for
himself and not for IBM)

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org