public void testT12() throws Exception {
Call call = new Call(DOC_ENDPOINT);
call.setOperationStyle(Style.DOCUMENT);
call.setSOAPVersion(SOAPConstants.SOAP12_CONSTANTS);
SOAPEnvelope reqEnv = new SOAPEnvelope(SOAPConstants.SOAP12_CONSTANTS);
SOAPHeaderElement header = new SOAPHeaderElement(TEST_NS, "Unknown");
header.setObjectValue("test header");
header.setMustUnderstand(true);
reqEnv.addHeader(header);
try {
call.invoke(reqEnv);
} catch (AxisFault fault) {
assertEquals(Constants.FAULT_SOAP12_MUSTUNDERSTAND,
fault.getFaultCode());
ArrayList headers = fault.getHeaders();
// If there is a NotUnderstood header, check it
for (Iterator i = headers.iterator(); i.hasNext();) {
SOAPHeaderElement h = (SOAPHeaderElement) i.next();
if (h.getQName().equals(Constants.QNAME_NOTUNDERSTOOD)) {
// TODO : check qname attribute
}
}
return;
}