I am trying to sign a SOAP message using wssj. I need to pass the soap envelope as a Document type. I tried doing this: SOAPMessageContext soapCntxt = (SOAPMessageContext)context; SOAPMessage message = soapCntxt.getMessage(); SOAPPart soapPart = message.getSOAPPart(); Document envelope = (Document)soapPart;
This compiles but I get run time error of
Service exception java.lang.ClassCastException: org.apache.axis.message.Text cannot be cast to org.apache.axis.message.SOAPHeaderElement
Also, if the SOAPMessage is created from a file input stream with the below content, the tested version of the code pasted above does not seem to work. Is there a way to just get the XML part ignoring the rest?