Java Reference
In-Depth Information
Boolean outboundProperty = (Boolean)
ctx.get (MessageContext.MESSAGE_OUTBOUND_PROPERTY);
if (outboundProperty.booleanValue()) {
System.out.println("\nOutbound message:");
} else {
try {
System.out.println("\nInbound message:");
ctx.getMessage().writeTo(System.out);
} catch (SOAPException ex) {
ex.printStackTrace();
} catch (IOException ex) {
ex.printStackTrace();
}
}
}
}
Recall that there are two kinds of handlers: protocol handlers and logical handlers. Because
you've used a protocol handler, you have access to the SOAP envelope via the SAAJ API.
Protocol handlers are concerned with processing related to the binding information in the
WSDL, so the message appears to the handler as a SOAP message. Logical handlers, on the
other hand, see the message payload as either a javax.xml.transform.Source or a JAXB
annotated instance.
NOTE
You can mix and match handler types within the same chain.
Search WWH ::




Custom Search