Hi All,
I have configured my handlers.xml like this :
<handler-chains xmlns="http://java.sun.com/xml/ns/javaee">
<handler-chain>
<handler>
<handler-class>fromjava.server.MyHandler1</handler-class>
</handler>
<handler>
<handler-class>fromjava.server.MyHandler2</handler-class>
</handler>
<handler>
<handler-class>fromjava.server.MyHandler3</handler-class>
</handler>
</handler-chain>
</handler-chains>
I sent a request from Client side and in each of the handler's handleMessage(SOAPMessageContext smc) , I am printing the output to a file like :
//MyHandler1.java
try {
FileWriter fw = new FileWriter(f,true);
if((Boolean)smc.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY) == true)
fw.write("MyHandler1 Outgoing *********");
else
fw.write("MyHandler1 Incoming *********");
fw.close();
} catch (IOException e) {
e.printStackTrace();
}
//MyHandler2.java
try {
FileWriter fw = new FileWriter(f,true);
if((Boolean)smc.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY) == true)
fw.write("MyHandler2 Outgoing *********");
else
fw.write("MyHandler2 Incoming *********");
fw.close();
} catch (IOException e) {
e.printStackTrace();
}
//MyHandler3.java
try {
FileWriter fw = new FileWriter(f,true);
if((Boolean)smc.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY) == true)
fw.write("MyHandler3 Outgoing *********");
else
fw.write("MyHandler3 Incoming *********");
fw.close();
} catch (IOException e) {
e.printStackTrace();
}
I sent a request from Client side and the file produces this output.
MyHandler3 Incoming *********
MyHandler2 Incoming *********
MyHandler1 Incoming *********
MyHandler1 Outgoing *********
MyHandler2 Outgoing *********
MyHandler3 Outgoing *********
Is this order right , I thought MyHandler1 will get the input request first !