I have implemented SOAPHandler, now in my handleMessage method i want to save SoapHeader into oracle database.
I got soapHeader like following
@Override
public boolean handleMessage(SOAPMessageContext context) {
Boolean outboundProperty = (Boolean) context.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
if (outboundProperty.booleanValue()) {
System.out.println("\nOutbound message:");
} else {
System.out.println("\nInbound message:");
try {
SOAPMessage soapMessage = context.getMessage();
SOAPPart soapPart = soapMessage.getSOAPPart();
SOAPEnvelope soapEnvelope = soapPart.getEnvelope();
SOAPHeader soapHeader = soapEnvelope.getHeader();
SOAPBody soapBody = soapEnvelope.getBody();
}
To save soapheader in DB using JPA i required entitymanagerfactory in soaphandler class. i try with @persistenceunit but it gives error that my soaphandler class not found in web application.
Regards,
imran
Its not a good idea to do DataBase manipulation in handler, i just parse soapheader and let it go to webservice and did database tasks in it.
Regards,
imran