- java.lang.Object
-
- jakarta.xml.soap.SOAPMessage
-
- com.sun.xml.wss.impl.SecurableSoapMessage
-
public final class SecurableSoapMessage extends jakarta.xml.soap.SOAPMessage
-
-
Constructor Summary
Constructors Constructor Description SecurableSoapMessage()SecurableSoapMessage(jakarta.xml.soap.SOAPMessage soapMessage)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAttachmentPart(jakarta.xml.soap.AttachmentPart AttachmentPart)intcountAttachments()jakarta.xml.soap.AttachmentPartcreateAttachmentPart()jakarta.xml.soap.AttachmentPartcreateAttachmentPart(jakarta.activation.DataHandler dataHandler)jakarta.xml.soap.AttachmentPartcreateAttachmentPart(Object content, String contentType)voiddeleteSecurityHeader()Delete security headerbooleanequals(Object obj)SecurityHeaderfindOrCreateSecurityHeader()Finds or creates wsse:Security HeaderSecurityHeaderfindSecurityHeader()Finds wsse:Security HeaderSecurityHeaderfindWsseSecurityHeaderBlock(boolean doCreate, boolean mustUnderstand)Finds wsse:Security Header Block.voidgenerateFault(WssSoapFaultException sfe)StringgenerateId()voidgenerateSecurityHeaderException(String exceptionMessage)Create and initialize a SecurityHeaderException, and throw a fault based on it.voidgenerateWsuId(Element element)voidgenerateWsuId(Element element, String id)jakarta.xml.soap.AttachmentPartgetAttachment(jakarta.xml.soap.SOAPElement element)jakarta.xml.soap.AttachmentPartgetAttachmentPart(String uri)IteratorgetAttachments()IteratorgetAttachments(jakarta.xml.soap.MimeHeaders headers)StringgetContentDescription()ElementgetElementById(String id)jakarta.xml.soap.SOAPElementgetElementByWsuId(String id)jakarta.xml.soap.SOAPEnvelopegetEnvelope()static StringgetIdFromFragmentRef(String ref)ObjectgetMessageParts(Target target)jakarta.xml.soap.MimeHeadersgetMimeHeaders()NamespaceContextgetNamespaceContext()ObjectgetProperty(String property)jakarta.xml.soap.SOAPBodygetSOAPBody()jakarta.xml.soap.SOAPHeadergetSOAPHeader()jakarta.xml.soap.SOAPMessagegetSOAPMessage()jakarta.xml.soap.SOAPPartgetSOAPPart()inthashCode()voidinit(jakarta.xml.soap.SOAPMessage soapMessage)booleanisOptimized()static WssSoapFaultExceptionnewSOAPFaultException(String faultstring, Throwable th)Create and initialize a WssSoapFaultException.static WssSoapFaultExceptionnewSOAPFaultException(QName faultCode, String faultstring, Throwable th)Create and initialize a WssSoapFaultException.voidremoveAllAttachments()voidremoveAttachments(jakarta.xml.soap.MimeHeaders hdrs)voidresetMustUnderstandOnSecHeader()Make Security Header Non-MustUnderstandvoidsaveChanges()booleansaveRequired()voidsetContentDescription(String description)voidsetDoNotSetMU(boolean doNotSetMU)voidsetOptimized(boolean optimized)voidsetProperty(String property, Object value)voidsetSOAPMessage(jakarta.xml.soap.SOAPMessage soapMsg)StringtoString()voidwriteTo(OutputStream out)
-
-
-
Constructor Detail
-
SecurableSoapMessage
public SecurableSoapMessage()
-
SecurableSoapMessage
public SecurableSoapMessage(jakarta.xml.soap.SOAPMessage soapMessage) throws XWSSecurityException- Parameters:
soapMessage-- Throws:
XWSSecurityException
-
-
Method Detail
-
init
public void init(jakarta.xml.soap.SOAPMessage soapMessage) throws XWSSecurityException- Throws:
XWSSecurityException
-
getEnvelope
public jakarta.xml.soap.SOAPEnvelope getEnvelope() throws XWSSecurityException- 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
public SecurityHeader findSecurityHeader() throws XWSSecurityException
Finds wsse:Security Header- Returns:
- returns null if wsse:Security header not found
- Throws:
XWSSecurityException
-
findOrCreateSecurityHeader
public SecurityHeader findOrCreateSecurityHeader() throws XWSSecurityException
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
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 XWSSecurityException
- Parameters:
sfe-- Throws:
XWSSecurityException
-
getSOAPPart
public jakarta.xml.soap.SOAPPart getSOAPPart()
- Specified by:
getSOAPPartin classjakarta.xml.soap.SOAPMessage
-
getSOAPBody
public jakarta.xml.soap.SOAPBody getSOAPBody() throws jakarta.xml.soap.SOAPException- Overrides:
getSOAPBodyin classjakarta.xml.soap.SOAPMessage- Throws:
jakarta.xml.soap.SOAPException
-
getSOAPMessage
public jakarta.xml.soap.SOAPMessage getSOAPMessage()
-
setSOAPMessage
public void setSOAPMessage(jakarta.xml.soap.SOAPMessage soapMsg) throws XWSSecurityException- Throws:
XWSSecurityException
-
addAttachmentPart
public void addAttachmentPart(jakarta.xml.soap.AttachmentPart AttachmentPart)
- Specified by:
addAttachmentPartin classjakarta.xml.soap.SOAPMessage
-
countAttachments
public int countAttachments()
- Specified by:
countAttachmentsin classjakarta.xml.soap.SOAPMessage
-
createAttachmentPart
public jakarta.xml.soap.AttachmentPart createAttachmentPart()
- Specified by:
createAttachmentPartin classjakarta.xml.soap.SOAPMessage
-
createAttachmentPart
public jakarta.xml.soap.AttachmentPart createAttachmentPart(Object content, String contentType)
- Overrides:
createAttachmentPartin classjakarta.xml.soap.SOAPMessage
-
createAttachmentPart
public jakarta.xml.soap.AttachmentPart createAttachmentPart(jakarta.activation.DataHandler dataHandler)
- Overrides:
createAttachmentPartin classjakarta.xml.soap.SOAPMessage
-
getAttachments
public Iterator getAttachments()
- Specified by:
getAttachmentsin classjakarta.xml.soap.SOAPMessage
-
getAttachments
public Iterator getAttachments(jakarta.xml.soap.MimeHeaders headers)
- Specified by:
getAttachmentsin classjakarta.xml.soap.SOAPMessage
-
getContentDescription
public String getContentDescription()
- Specified by:
getContentDescriptionin classjakarta.xml.soap.SOAPMessage
-
getMimeHeaders
public jakarta.xml.soap.MimeHeaders getMimeHeaders()
- Specified by:
getMimeHeadersin classjakarta.xml.soap.SOAPMessage
-
getProperty
public Object getProperty(String property) throws jakarta.xml.soap.SOAPException
- Overrides:
getPropertyin classjakarta.xml.soap.SOAPMessage- Throws:
jakarta.xml.soap.SOAPException
-
getSOAPHeader
public jakarta.xml.soap.SOAPHeader getSOAPHeader() throws jakarta.xml.soap.SOAPException- Overrides:
getSOAPHeaderin classjakarta.xml.soap.SOAPMessage- Throws:
jakarta.xml.soap.SOAPException
-
removeAllAttachments
public void removeAllAttachments()
- Specified by:
removeAllAttachmentsin classjakarta.xml.soap.SOAPMessage
-
saveRequired
public boolean saveRequired()
- Specified by:
saveRequiredin classjakarta.xml.soap.SOAPMessage
-
setContentDescription
public void setContentDescription(String description)
- Specified by:
setContentDescriptionin classjakarta.xml.soap.SOAPMessage
-
setProperty
public void setProperty(String property, Object value) throws jakarta.xml.soap.SOAPException
- Overrides:
setPropertyin classjakarta.xml.soap.SOAPMessage- Throws:
jakarta.xml.soap.SOAPException
-
writeTo
public void writeTo(OutputStream out) throws jakarta.xml.soap.SOAPException, IOException
- Specified by:
writeToin classjakarta.xml.soap.SOAPMessage- Throws:
jakarta.xml.soap.SOAPExceptionIOException
-
saveChanges
public void saveChanges() throws jakarta.xml.soap.SOAPException- Specified by:
saveChangesin classjakarta.xml.soap.SOAPMessage- Throws:
jakarta.xml.soap.SOAPException
-
getNamespaceContext
public NamespaceContext getNamespaceContext() throws XWSSecurityException
- Throws:
XWSSecurityException
-
generateId
public String generateId() throws XWSSecurityException
- Returns:
- an ID unique w.r.t this SOAPMessage
- Throws:
XWSSecurityException
-
generateWsuId
public void generateWsuId(Element element) throws XWSSecurityException
- Parameters:
element-- Throws:
XWSSecurityException
-
generateWsuId
public void generateWsuId(Element element, String id) throws XWSSecurityException
- Parameters:
element-id- ID specified should be unique in the message.- Throws:
XWSSecurityException
-
getElementByWsuId
public jakarta.xml.soap.SOAPElement getElementByWsuId(String id) throws XWSSecurityException
- Throws:
XWSSecurityException
-
getElementById
public Element getElementById(String id) throws XWSSecurityException
- Throws:
XWSSecurityException
-
getAttachmentPart
public jakarta.xml.soap.AttachmentPart getAttachmentPart(String uri) throws XWSSecurityException
- Throws:
XWSSecurityException
-
getMessageParts
public Object getMessageParts(Target target) throws XWSSecurityException
- Throws:
XWSSecurityException
-
getAttachment
public jakarta.xml.soap.AttachmentPart getAttachment(jakarta.xml.soap.SOAPElement element) throws jakarta.xml.soap.SOAPException- Specified by:
getAttachmentin classjakarta.xml.soap.SOAPMessage- Throws:
jakarta.xml.soap.SOAPException
-
removeAttachments
public void removeAttachments(jakarta.xml.soap.MimeHeaders hdrs)
- Specified by:
removeAttachmentsin classjakarta.xml.soap.SOAPMessage
-
isOptimized
public boolean isOptimized()
-
setOptimized
public void setOptimized(boolean optimized)
-
setDoNotSetMU
public void setDoNotSetMU(boolean doNotSetMU)
-
-