|
Hi,
I'm using Handler to intercept SOAP message. I append "an information" to the soap message Request, but i can't find it in the response!! Can you help me? My Handler contains this:
/****************************/
public boolean handleRequest(javax.xml.rpc.handler.MessageContext context) { if (context instanceof SOAPMessageContext)
{
try {
SOAPMessageContext soapMsgCtx =
(SOAPMessageContext)context;
SOAPMessage soapMsg =
soapMsgCtx.getMessage();
SOAPPart sp = soapMsg.getSOAPPart();
SOAPEnvelope se = sp.getEnvelope();
SOAPBody sb = se.getBody();
SOAPHeader sh = se.getHeader();
// soap message enrichment
Name name = se.createName("Test");
SOAPHeaderElement hdr =
sh.addHeaderElement(name);
hdr.addTextNode("DATA");
}catch (SOAPException ex)
{ex.printStackTrace();}
} return true; } public boolean
handleResponse(javax.xml.rpc.handler.MessageContext context) {
if (context instanceof SOAPMessageContext) { try { SOAPMessageContext soapMsgCtx = (SOAPMessageContext)context; SOAPMessage soapMsg = soapMsgCtx.getMessage(); SOAPPart sp = soapMsg.getSOAPPart(); SOAPEnvelope se = sp.getEnvelope(); SOAPBody sb = se.getBody(); SOAPHeader sh = se.getHeader(); java.util.Iterator it= sh.examineAllHeaderElements(); String tab[]=new String[10]; try{ int i=0; while (it.hasNext()) { SOAPHeaderElement e =(SOAPHeaderElement)it.next(); tab[i] =e.getValue(); System.out.println(tab[i]); i++; // I can't find (int the table) the request enrichment (Test & DATA) } } catch (SOAPException ex) {ex.printStackTrace();} } return true; } /****************************/
Thanks in advance.
Riadh |
- SOAP Managment/ intercept request and response Riadh BEN HALIMA
- Re: SOAP Managment/ intercept request and response robert lazarski
- Re: SOAP Managment/ intercept request and respon... Riadh BEN HALIMA
- Re: SOAP Managment/ intercept request and re... robert lazarski
- I want to add an information to soap-req... Riadh BEN HALIMA
- Re: I want to add an information to... robert lazarski
- Re: I want to add an informatio... Riadh BEN HALIMA
- Re: I want to add an inform... robert lazarski
