permaculture playing cards*
The moose likes Web Services and the fly likes Order of SOAP Handler call in JAX-WS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Order of SOAP Handler call in JAX-WS " Watch "Order of SOAP Handler call in JAX-WS " New topic
Author

Order of SOAP Handler call in JAX-WS

Nikita Dutt
Greenhorn

Joined: Dec 24, 2010
Posts: 20
Hi All,

I am trying to understand how a JAX-WS protocol handler gets executed on the server side. Have written a code where i thought the


output would be

------------------------------------
In SOAPHandler SOAPHandlerOne method:handleMessage - direction = inbound
------------------------------------
------------------------------------
In SOAPHandler SOAPHandlerTwo method:handleMessage - direction = inbound
------------------------------------


but am getting the output as


------------------------------------
In SOAPHandler SOAPHandlerTwo method:handleMessage - direction = inbound
------------------------------------
------------------------------------
In SOAPHandler SOAPHandlerOne method:handleMessage - direction = inbound
------------------------------------


Please let me know what am i missing , if this is an expected behavior ? then why ?

Handlers Code


First Handler





Second Handler






The handler-chain.xml file

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<javaee:handler-chains xmlns:javaee="http://java.sun.com/xml/ns/javaee" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<javaee:handler-chain>
<javaee:handler>
<javaee:handler-class>com.company.jaxws.handler.cardservice.common.SOAPHandlerOne</javaee:handler-class>
</javaee:handler>
<javaee:handler>
<javaee:handler-class>com.company.jaxws.handler.cardservice.common.SOAPHandlerTwo</javaee:handler-class>
</javaee:handler>
</javaee:handler-chain>
</javaee:handler-chains>


Why is it calling SOAPHandlerTwo before SOAPHandlerOne ?


similary if i have LogicalHandler along with the SOAPHandlerOne the output is coming as

------------------------------------
In SOAPHandler SOAPHandlerTwo method:handleMessage - direction = inbound
------------------------------------
------------------------------------
In SOAPHandler SOAPHandlerOne method:handleMessage - direction = inbound
------------------------------------
------------------------------------
In SOAPHandler LogicalHandlerThree method:handleMessage - direction = inbound
------------------------------------
------------------------------------
In SOAPHandler LogicalHandlerTwo method:handleMessage - direction = inbound
------------------------------------
------------------------------------
In SOAPHandler LogicalHandlerOne method:handleMessage - direction = inbound
------------------------------------



and not as


------------------------------------
In SOAPHandler SOAPHandlerOne method:handleMessage - direction = inbound
------------------------------------
------------------------------------
In SOAPHandler SOAPHandlerTwo method:handleMessage - direction = inbound
------------------------------------
------------------------------------
In SOAPHandler LogicalHandlerOne method:handleMessage - direction = inbound
------------------------------------
------------------------------------
In SOAPHandler LogicalHandlerTwo method:handleMessage - direction = inbound
------------------------------------
------------------------------------
In SOAPHandler LogicalHandlerThree method:handleMessage - direction = inbound
------------------------------------

Complete handler-chain.xml


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<javaee:handler-chains xmlns:javaee="http://java.sun.com/xml/ns/javaee" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<javaee:handler-chain>
<javaee:handler>
<javaee:handler-class>com.company.jaxws.handler.cardservice.common.SOAPHandlerOne</javaee:handler-class>
</javaee:handler>
<javaee:handler>
<javaee:handler-class>com.company.jaxws.handler.cardservice.common.SOAPHandlerTwo</javaee:handler-class>
</javaee:handler>
<javaee:handler>
<javaee:handler-class>com.company.jaxws.handler.cardservice.common.LogicalHandlerOne</javaee:handler-class>
</javaee:handler>
<javaee:handler>
<javaee:handler-class>com.company.jaxws.handler.cardservice.common.LogicalHandlerTwo</javaee:handler-class>
</javaee:handler>
<javaee:handler>
<javaee:handler-class>com.company.jaxws.handler.cardservice.common.LogicalHandlerThree</javaee:handler-class>
</javaee:handler>
</javaee:handler-chain>
</javaee:handler-chains>






Thanks in advance.

Nikita Dutt
Greenhorn

Joined: Dec 24, 2010
Posts: 20
any luck for me ...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Order of SOAP Handler call in JAX-WS
 
Similar Threads
Convert SOAP response to SOAP XmL string using JAX WS
NullPointerException Trying to Get RemoteIP (why?)
JAX-RPC web service soap message handler issues
jax-ws handler causing exception
Soap Handler question