1 37 38 package com.sun.j2ee.blueprints.opc.otwebservice; 39 40 import java.util.*; 41 import javax.xml.rpc.handler.*; 42 import javax.xml.rpc.handler.soap.*; 43 import javax.xml.soap.*; 44 import javax.xml.namespace.QName ; 45 46 public class OtMessageHandler extends javax.xml.rpc.handler.GenericHandler { 47 48 public OtMessageHandler() { 49 System.out.println("Initializaing OtMessageHandler"); 50 } 51 52 public boolean handleRequest(MessageContext context) { 53 System.out.println("Initializaing OtMessageHandler"); 54 try { 55 SOAPMessageContext smc = (SOAPMessageContext)context; 56 SOAPMessage msg = smc.getMessage(); 57 SOAPPart sp = msg.getSOAPPart(); 58 SOAPEnvelope se = sp.getEnvelope(); 59 SOAPHeader sh = se.getHeader(); 60 SOAPBody body = se.getBody(); 61 Iterator it = body.getChildElements(); 62 while ((it != null) && it.hasNext()) { 63 System.out.println("OtMessageHandler:" + it.next()); 64 } 65 } catch(Exception ex) { 69 } 71 return true; 72 } 73 74 public boolean handleResponse(MessageContext context) { 75 System.out.println("OtMessageHandler: handleResponse"); 76 return true; 77 } 78 80 public QName [] getHeaders() { 81 return null; 82 } 83 84 } 85 | Popular Tags |