Package com.sun.xml.wss.impl
Class SecurableSoapMessage
java.lang.Object
javax.xml.soap.SOAPMessage
com.sun.xml.wss.impl.SecurableSoapMessage
public final class SecurableSoapMessage
extends javax.xml.soap.SOAPMessage
-
Field Summary
Fields inherited from class javax.xml.soap.SOAPMessage
CHARACTER_SET_ENCODING, WRITE_XML_DECLARATION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttachmentPart(javax.xml.soap.AttachmentPart AttachmentPart) intjavax.xml.soap.AttachmentPartjavax.xml.soap.AttachmentPartcreateAttachmentPart(Object content, String contentType) javax.xml.soap.AttachmentPartcreateAttachmentPart(javax.activation.DataHandler dataHandler) voidDelete security headerbooleanFinds or creates wsse:Security HeaderFinds wsse:Security HeaderfindWsseSecurityHeaderBlock(boolean doCreate, boolean mustUnderstand) Finds wsse:Security Header Block.voidvoidgenerateSecurityHeaderException(String exceptionMessage) Create and initialize a SecurityHeaderException, and throw a fault based on it.voidgenerateWsuId(Element element) voidgenerateWsuId(Element element, String id) javax.xml.soap.AttachmentPartgetAttachment(javax.xml.soap.SOAPElement element) javax.xml.soap.AttachmentPartgetAttachmentPart(String uri) getAttachments(javax.xml.soap.MimeHeaders headers) getElementById(String id) javax.xml.soap.SOAPElementjavax.xml.soap.SOAPEnvelopestatic StringgetMessageParts(Target target) javax.xml.soap.MimeHeadersgetProperty(String property) javax.xml.soap.SOAPBodyjavax.xml.soap.SOAPHeaderjavax.xml.soap.SOAPMessagejavax.xml.soap.SOAPPartinthashCode()voidinit(javax.xml.soap.SOAPMessage soapMessage) booleanstatic WssSoapFaultExceptionnewSOAPFaultException(String faultstring, Throwable th) Create and initialize a WssSoapFaultException.static WssSoapFaultExceptionnewSOAPFaultException(QName faultCode, String faultstring, Throwable th) Create and initialize a WssSoapFaultException.voidvoidremoveAttachments(javax.xml.soap.MimeHeaders hdrs) voidMake Security Header Non-MustUnderstandvoidbooleanvoidsetContentDescription(String description) voidsetDoNotSetMU(boolean doNotSetMU) voidsetOptimized(boolean optimized) voidsetProperty(String property, Object value) voidsetSOAPMessage(javax.xml.soap.SOAPMessage soapMsg) toString()voidwriteTo(OutputStream out)
-
Constructor Details
-
SecurableSoapMessage
public SecurableSoapMessage() -
SecurableSoapMessage
- Parameters:
soapMessage-- Throws:
XWSSecurityException
-
-
Method Details
-
init
- Throws:
XWSSecurityException
-
getEnvelope
- Throws:
XWSSecurityException
-
findWsseSecurityHeaderBlock
public SecurityHeader findWsseSecurityHeaderBlock(boolean doCreate, boolean mustUnderstand) throws XWSSecurityException Finds wsse:Security Header Block.- Parameters:
doCreate- create one if none exists- Returns:
- wsse:Security header
- Throws:
XWSSecurityException
-
findSecurityHeader
Finds wsse:Security Header- Returns:
- returns null if wsse:Security header not found
- Throws:
XWSSecurityException
-
findOrCreateSecurityHeader
Finds or creates wsse:Security Header- Returns:
- wsse:Security header
- Throws:
XWSSecurityException
-
deleteSecurityHeader
public void deleteSecurityHeader()Delete security header -
resetMustUnderstandOnSecHeader
public void resetMustUnderstandOnSecHeader()Make Security Header Non-MustUnderstand -
generateSecurityHeaderException
public void generateSecurityHeaderException(String exceptionMessage) throws SecurityHeaderException, XWSSecurityException Create and initialize a SecurityHeaderException, and throw a fault based on it. The faultstring for this exception is wsse:InvalidSecurity as per section 12 on Error Handling of the wss SOAPMessageSecurity spec (draft 17). This fault stands for An error was discovered processing the wsse:Security header. -
newSOAPFaultException
Create and initialize a WssSoapFaultException. This method is used in conjunction with generateClientFault. -
newSOAPFaultException
public static WssSoapFaultException newSOAPFaultException(QName faultCode, String faultstring, Throwable th) Create and initialize a WssSoapFaultException. This method is used in conjunction with generateClientFault. -
generateFault
- Parameters:
sfe-- Throws:
XWSSecurityException
-
getSOAPPart
public javax.xml.soap.SOAPPart getSOAPPart()- Specified by:
getSOAPPartin classjavax.xml.soap.SOAPMessage
-
getSOAPBody
public javax.xml.soap.SOAPBody getSOAPBody() throws javax.xml.soap.SOAPException- Overrides:
getSOAPBodyin classjavax.xml.soap.SOAPMessage- Throws:
javax.xml.soap.SOAPException
-
getSOAPMessage
public javax.xml.soap.SOAPMessage getSOAPMessage() -
setSOAPMessage
- Throws:
XWSSecurityException
-
addAttachmentPart
public void addAttachmentPart(javax.xml.soap.AttachmentPart AttachmentPart) - Specified by:
addAttachmentPartin classjavax.xml.soap.SOAPMessage
-
countAttachments
public int countAttachments()- Specified by:
countAttachmentsin classjavax.xml.soap.SOAPMessage
-
createAttachmentPart
public javax.xml.soap.AttachmentPart createAttachmentPart()- Specified by:
createAttachmentPartin classjavax.xml.soap.SOAPMessage
-
createAttachmentPart
- Overrides:
createAttachmentPartin classjavax.xml.soap.SOAPMessage
-
createAttachmentPart
public javax.xml.soap.AttachmentPart createAttachmentPart(javax.activation.DataHandler dataHandler) - Overrides:
createAttachmentPartin classjavax.xml.soap.SOAPMessage
-
equals
-
getAttachments
- Specified by:
getAttachmentsin classjavax.xml.soap.SOAPMessage
-
getAttachments
- Specified by:
getAttachmentsin classjavax.xml.soap.SOAPMessage
-
getContentDescription
- Specified by:
getContentDescriptionin classjavax.xml.soap.SOAPMessage
-
getMimeHeaders
public javax.xml.soap.MimeHeaders getMimeHeaders()- Specified by:
getMimeHeadersin classjavax.xml.soap.SOAPMessage
-
getProperty
- Overrides:
getPropertyin classjavax.xml.soap.SOAPMessage- Throws:
javax.xml.soap.SOAPException
-
getSOAPHeader
public javax.xml.soap.SOAPHeader getSOAPHeader() throws javax.xml.soap.SOAPException- Overrides:
getSOAPHeaderin classjavax.xml.soap.SOAPMessage- Throws:
javax.xml.soap.SOAPException
-
hashCode
public int hashCode() -
removeAllAttachments
public void removeAllAttachments()- Specified by:
removeAllAttachmentsin classjavax.xml.soap.SOAPMessage
-
saveRequired
public boolean saveRequired()- Specified by:
saveRequiredin classjavax.xml.soap.SOAPMessage
-
setContentDescription
- Specified by:
setContentDescriptionin classjavax.xml.soap.SOAPMessage
-
setProperty
- Overrides:
setPropertyin classjavax.xml.soap.SOAPMessage- Throws:
javax.xml.soap.SOAPException
-
toString
-
writeTo
- Specified by:
writeToin classjavax.xml.soap.SOAPMessage- Throws:
javax.xml.soap.SOAPExceptionIOException
-
saveChanges
public void saveChanges() throws javax.xml.soap.SOAPException- Specified by:
saveChangesin classjavax.xml.soap.SOAPMessage- Throws:
javax.xml.soap.SOAPException
-
getNamespaceContext
- Throws:
XWSSecurityException
-
generateId
- Returns:
- an ID unique w.r.t this SOAPMessage
- Throws:
XWSSecurityException
-
generateWsuId
- Parameters:
element-- Throws:
XWSSecurityException
-
generateWsuId
- Parameters:
element-id- ID specified should be unique in the message.- Throws:
XWSSecurityException
-
getElementByWsuId
- Throws:
XWSSecurityException
-
getElementById
- Throws:
XWSSecurityException
-
getAttachmentPart
- Throws:
XWSSecurityException
-
getIdFromFragmentRef
-
getMessageParts
- Throws:
XWSSecurityException
-
getAttachment
public javax.xml.soap.AttachmentPart getAttachment(javax.xml.soap.SOAPElement element) throws javax.xml.soap.SOAPException - Specified by:
getAttachmentin classjavax.xml.soap.SOAPMessage- Throws:
javax.xml.soap.SOAPException
-
removeAttachments
public void removeAttachments(javax.xml.soap.MimeHeaders hdrs) - Specified by:
removeAttachmentsin classjavax.xml.soap.SOAPMessage
-
isOptimized
public boolean isOptimized() -
setOptimized
public void setOptimized(boolean optimized) -
setDoNotSetMU
public void setDoNotSetMU(boolean doNotSetMU)
-