In which order do LogicalHandlers and SOAPHandlers configured on a Web Service endpoint execute on an incoming message ? (Choose one)
A.
SOAPHandlers in the order specified in configuration are executed first and later the LogicalHandlers specified in the order get executed
B.
LogicalHandlers in the order specified in configuration are executed first and later the SOAPHandlers specified in the order get executed
C.
All the handlers are executed in the order specified in the configuration
D.
All the handlers are executed in the reverse order specified in the configuration.
A SOAPHandler gives the programmer
access to the entire SOAP message, whereas the convenient LogicalHandler gives the
programmer access to the payload of the SOAP body. A SOAPHandler often is called a
message handler and a LogicalHandler is called simply a logical handler
One sample of SOAPHandler
class ClientHashHandler implements SOAPHandler {
public Set getHeaders() { return null; }
public boolean handleFault(SOAPMessageContext mCtx) {
try {
SOAPMessage msg = mCtx.getMessage();
msg.writeTo(System.err);
}
catch(Exception e) { throw new RuntimeException(e); }
return true;
}
public boolean handleMessage(SOAPMessageContext mCtx) {
SOAPMessage soapMessage = mCtx.getMessage();
SOAPEnvelope envelope = soapMessage.getSOAPPart().getEnvelope();
SOAPHeader header = envelope.getHeader();
QName qn = new QName(“http://predictionsSOAP”, “credentials”);
header.addHeaderElement(qn);
// Now insert credentials into the header.
Node firstChild = header.getFirstChild();
append(firstChild, “Name”, this.name);
append(firstChild, “Signature”, signature);
append(firstChild, “Timestamp”, timeStamp);
}
}
Answer A