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 SOAPMessage
-
-
Field Summary
-
Fields inherited from class javax.xml.soap.SOAPMessage
CHARACTER_SET_ENCODING, WRITE_XML_DECLARATION
-
-
Constructor Summary
Constructors Constructor Description SecurableSoapMessage()SecurableSoapMessage(SOAPMessage soapMessage)
-
Method Summary
-
-
-
Constructor Detail
-
SecurableSoapMessage
public SecurableSoapMessage()
-
SecurableSoapMessage
public SecurableSoapMessage(SOAPMessage soapMessage) throws com.sun.xml.wss.XWSSecurityException
- Parameters:
soapMessage-- Throws:
com.sun.xml.wss.XWSSecurityException
-
-
Method Detail
-
init
public void init(SOAPMessage soapMessage) throws com.sun.xml.wss.XWSSecurityException
- Throws:
com.sun.xml.wss.XWSSecurityException
-
getEnvelope
public SOAPEnvelope getEnvelope() throws com.sun.xml.wss.XWSSecurityException
- Throws:
com.sun.xml.wss.XWSSecurityException
-
findWsseSecurityHeaderBlock
public SecurityHeader findWsseSecurityHeaderBlock(boolean doCreate, boolean mustUnderstand) throws com.sun.xml.wss.XWSSecurityException
Finds wsse:Security Header Block.- Parameters:
doCreate- create one if none exists- Returns:
- wsse:Security header
- Throws:
com.sun.xml.wss.XWSSecurityException
-
findSecurityHeader
public SecurityHeader findSecurityHeader() throws com.sun.xml.wss.XWSSecurityException
Finds wsse:Security Header- Returns:
- returns null if wsse:Security header not found
- Throws:
com.sun.xml.wss.XWSSecurityException
-
findOrCreateSecurityHeader
public SecurityHeader findOrCreateSecurityHeader() throws com.sun.xml.wss.XWSSecurityException
Finds or creates wsse:Security Header- Returns:
- wsse:Security header
- Throws:
com.sun.xml.wss.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, com.sun.xml.wss.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.- Throws:
SecurityHeaderExceptioncom.sun.xml.wss.XWSSecurityException
-
newSOAPFaultException
public static WssSoapFaultException newSOAPFaultException(String faultstring, Throwable th)
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
public void generateFault(WssSoapFaultException sfe) throws com.sun.xml.wss.XWSSecurityException
- Parameters:
sfe-- Throws:
com.sun.xml.wss.XWSSecurityException
-
getSOAPPart
public SOAPPart getSOAPPart()
- Specified by:
getSOAPPartin classSOAPMessage
-
getSOAPBody
public SOAPBody getSOAPBody() throws SOAPException
- Overrides:
getSOAPBodyin classSOAPMessage- Throws:
SOAPException
-
getSOAPMessage
public SOAPMessage getSOAPMessage()
-
setSOAPMessage
public void setSOAPMessage(SOAPMessage soapMsg) throws com.sun.xml.wss.XWSSecurityException
- Throws:
com.sun.xml.wss.XWSSecurityException
-
addAttachmentPart
public void addAttachmentPart(AttachmentPart AttachmentPart)
- Specified by:
addAttachmentPartin classSOAPMessage
-
countAttachments
public int countAttachments()
- Specified by:
countAttachmentsin classSOAPMessage
-
createAttachmentPart
public AttachmentPart createAttachmentPart()
- Specified by:
createAttachmentPartin classSOAPMessage
-
createAttachmentPart
public AttachmentPart createAttachmentPart(Object content, String contentType)
- Overrides:
createAttachmentPartin classSOAPMessage
-
createAttachmentPart
public AttachmentPart createAttachmentPart(DataHandler dataHandler)
- Overrides:
createAttachmentPartin classSOAPMessage
-
getAttachments
public Iterator getAttachments()
- Specified by:
getAttachmentsin classSOAPMessage
-
getAttachments
public Iterator getAttachments(MimeHeaders headers)
- Specified by:
getAttachmentsin classSOAPMessage
-
getContentDescription
public String getContentDescription()
- Specified by:
getContentDescriptionin classSOAPMessage
-
getMimeHeaders
public MimeHeaders getMimeHeaders()
- Specified by:
getMimeHeadersin classSOAPMessage
-
getProperty
public Object getProperty(String property) throws SOAPException
- Overrides:
getPropertyin classSOAPMessage- Throws:
SOAPException
-
getSOAPHeader
public SOAPHeader getSOAPHeader() throws SOAPException
- Overrides:
getSOAPHeaderin classSOAPMessage- Throws:
SOAPException
-
removeAllAttachments
public void removeAllAttachments()
- Specified by:
removeAllAttachmentsin classSOAPMessage
-
saveRequired
public boolean saveRequired()
- Specified by:
saveRequiredin classSOAPMessage
-
setContentDescription
public void setContentDescription(String description)
- Specified by:
setContentDescriptionin classSOAPMessage
-
setProperty
public void setProperty(String property, Object value) throws SOAPException
- Overrides:
setPropertyin classSOAPMessage- Throws:
SOAPException
-
writeTo
public void writeTo(OutputStream out) throws SOAPException, IOException
- Specified by:
writeToin classSOAPMessage- Throws:
SOAPExceptionIOException
-
saveChanges
public void saveChanges() throws SOAPException- Specified by:
saveChangesin classSOAPMessage- Throws:
SOAPException
-
getNamespaceContext
public NamespaceContext getNamespaceContext() throws com.sun.xml.wss.XWSSecurityException
- Throws:
com.sun.xml.wss.XWSSecurityException
-
generateId
public String generateId() throws com.sun.xml.wss.XWSSecurityException
- Returns:
- an ID unique w.r.t this SOAPMessage
- Throws:
com.sun.xml.wss.XWSSecurityException
-
generateWsuId
public void generateWsuId(Element element) throws com.sun.xml.wss.XWSSecurityException
- Parameters:
element-- Throws:
com.sun.xml.wss.XWSSecurityException
-
generateWsuId
public void generateWsuId(Element element, String id) throws com.sun.xml.wss.XWSSecurityException
- Parameters:
element-id- ID specified should be unique in the message.- Throws:
com.sun.xml.wss.XWSSecurityException
-
getElementByWsuId
public SOAPElement getElementByWsuId(String id) throws com.sun.xml.wss.XWSSecurityException
- Throws:
com.sun.xml.wss.XWSSecurityException
-
getElementById
public Element getElementById(String id) throws com.sun.xml.wss.XWSSecurityException
- Throws:
com.sun.xml.wss.XWSSecurityException
-
getAttachmentPart
public AttachmentPart getAttachmentPart(String uri) throws com.sun.xml.wss.XWSSecurityException
- Throws:
com.sun.xml.wss.XWSSecurityException
-
getMessageParts
public Object getMessageParts(Target target) throws com.sun.xml.wss.XWSSecurityException
- Throws:
com.sun.xml.wss.XWSSecurityException
-
getAttachment
public AttachmentPart getAttachment(SOAPElement element) throws SOAPException
- Specified by:
getAttachmentin classSOAPMessage- Throws:
SOAPException
-
removeAttachments
public void removeAttachments(MimeHeaders hdrs)
- Specified by:
removeAttachmentsin classSOAPMessage
-
isOptimized
public boolean isOptimized()
-
setOptimized
public void setOptimized(boolean optimized)
-
setDoNotSetMU
public void setDoNotSetMU(boolean doNotSetMU)
-
-