// MessageContext.MESSAGE_OUTBOUND_PROPERTY set by JAX_WS only if handler configured. But encode always a out bound.
packet.invocationProperties.put(MessageContext.MESSAGE_OUTBOUND_PROPERTY,true);
if(packet.invocationProperties.containsKey(ENCODER)){
return ((Encoder)packet.invocationProperties.get(ENCODER)).encode(packet, out);
} else {
return new JSONEncoder(packet,this).encode(out);
}
} finally {
if (out != null) {
try {
out.flush();