Methods Summary |
---|
public void | destroy()
|
public javax.xml.namespace.QName[] | getHeaders()
return null;
|
public boolean | handleFault(javax.xml.rpc.handler.MessageContext context)
return false;
|
public boolean | handleRequest(javax.xml.rpc.handler.MessageContext context)
System.out.println("Hey - in Handle request");
try {
SOAPMessageContext smc = (SOAPMessageContext) context;
SOAPMessage msg = smc.getMessage();
SOAPPart sp = msg.getSOAPPart();
SOAPEnvelope se = sp.getEnvelope();
SOAPHeader sh = se.getHeader();
Name name =
se.createName(
"HeaderTest",
"AXIS",
"http://xml.apache.org/axis");
SOAPHeaderElement she = sh.addHeaderElement(name);
she.setActor(_actorURI);
she.addAttribute(se.createName("counter", "", ""), "1");
she.addAttribute(se.createName("faultCounter", "", ""), "1");
} catch (Exception e) {
e.printStackTrace();
}
return true;
|
public boolean | handleResponse(javax.xml.rpc.handler.MessageContext context)
System.out.println("Hey - in Handle response");
try {
String counter = null;
String faultCounter = null;
SOAPMessageContext smc = (SOAPMessageContext) context;
SOAPMessage msg = smc.getMessage();
SOAPPart sp = msg.getSOAPPart();
SOAPEnvelope se = sp.getEnvelope();
SOAPHeader sh = se.getHeader();
SOAPBody sb = se.getBody();
Name name =
se.createName(
"HeaderTest",
"AXIS",
"http://xml.apache.org/axis");
Iterator iter = sh.extractHeaderElements(_actorURI);
while (iter.hasNext()) {
SOAPHeaderElement she = (SOAPHeaderElement) iter.next();
counter =
she.getAttributeValue(se.createName("counter", "", ""));
System.out.println(
"The counter in the element sent back is " + counter);
faultCounter =
she.getAttributeValue(se.createName("faultCounter", "", ""));
System.out.println(
"The faultCounter in the element sent back is " + faultCounter);
}
if ((counter != null) && (counter.equals("3")) && (!sb.hasFault())) {
JAXRPCHandlerTestCase.completeRoundtrip();
}
if ((faultCounter != null) && (faultCounter.equals("3")) && (sb.hasFault())) {
JAXRPCHandlerTestCase.setFaultRoundtrip(Integer.parseInt(faultCounter));
}
} catch (Exception e) {
e.printStackTrace();
}
return false;
|
public void | init(javax.xml.rpc.handler.HandlerInfo config)
|