I have to save SOAP envelope when user invokes my web service. So, I used a SOAP handler to intercept java web service to get SOAP body. My web service implementation class has annotation
@HandlerChain(file = "webServiceHandler.xml")
and webServiceHandler.xml contents are
<?xml version="1.0" encoding="UTF-8"?>
<javaee:handler-chains xmlns:javaee="http://ift.tt/nSRXKP">
<javaee:handler-chain>
<javaee:handler>
<javaee:handler- class>com.services.webServiceHandler</javaee:handler-class>
</javaee:handler>
</javaee:handler-chain>
This is working correctly in tomcat but when code is built in websphere it gives this error
"WSModuleDescr E WSWS7027E: JAX-WS Service Descriptions could not be correctly built because of the following error: javax.xml.ws.WebServiceException: Validation error: This is a Provider that does not specify a valid Provider interface. Implementation class: org.apache.cxf.js.rhino.DOMMessageProvider at org.apache.axis2.jaxws.ExceptionFactory.createWebServiceException(ExceptionFactory.java:173)"
To overcome this I tried getting SOAP body from WebServiceContext instead of using Handler.
MessageContext msgCtxt = webservicecontext.getMessageContext();
SOAPMessage soapMessage = ((SOAPMessageContext) msgCtxt).getMessage();
but I am getting "java.lang.ClassCastException: com.sun.xml.ws.server.EndpointMessageContextImpl cannot be cast to javax.xml.ws.handler.soap.SOAPMessageContext"
Any help would be appreciated on how to correct these errors ?
Aucun commentaire:
Enregistrer un commentaire