• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How can convert SOAP Message to Document?

 
Dave Trower
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Roger F. Gay
Ranch Hand
Posts: 408
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tested:

Untested:
 
Roger F. Gay
Ranch Hand
Posts: 408
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So the; how do you get it back into a SOAPMessage?
 
chaitu sravs
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic