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
-
-
Constructor Summary
Constructors Constructor Description SecurableSoapMessage()SecurableSoapMessage(javax.xml.soap.SOAPMessage soapMessage)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAttachmentPart(javax.xml.soap.AttachmentPart AttachmentPart)intcountAttachments()javax.xml.soap.AttachmentPartcreateAttachmentPart()javax.xml.soap.AttachmentPartcreateAttachmentPart(Object content, String contentType)javax.xml.soap.AttachmentPartcreateAttachmentPart(javax.activation.DataHandler dataHandler)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)javax.xml.soap.AttachmentPartgetAttachment(javax.xml.soap.SOAPElement element)javax.xml.soap.AttachmentPartgetAttachmentPart(String uri)IteratorgetAttachments()IteratorgetAttachments(javax.xml.soap.MimeHeaders headers)StringgetContentDescription()ElementgetElementById(String id)javax.xml.soap.SOAPElementgetElementByWsuId(String id)javax.xml.soap.SOAPEnvelopegetEnvelope()static StringgetIdFromFragmentRef(String ref)ObjectgetMessageParts(Target target)javax.xml.soap.MimeHeadersgetMimeHeaders()NamespaceContextgetNamespaceContext()ObjectgetProperty(String property)javax.xml.soap.SOAPBodygetSOAPBody()javax.xml.soap.SOAPHeadergetSOAPHeader()javax.xml.soap.SOAPMessagegetSOAPMessage()javax.xml.soap.SOAPPartgetSOAPPart()inthashCode()voidinit(javax.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(javax.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(javax.xml.soap.SOAPMessage soapMsg)StringtoString()voidwriteTo(OutputStream out)
-
-
-
Method Detail
-
init
public void init(javax.xml.soap.SOAPMessage soapMessage) throws com.sun.xml.wss.XWSSecurityException- Throws:
com.sun.xml.wss.XWSSecurityException
-
getEnvelope
public javax.xml.soap.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 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
public void setSOAPMessage(javax.xml.soap.SOAPMessage soapMsg) throws com.sun.xml.wss.XWSSecurityException- Throws:
com.sun.xml.wss.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
public javax.xml.soap.AttachmentPart createAttachmentPart(Object content, String contentType)
- Overrides:
createAttachmentPartin classjavax.xml.soap.SOAPMessage
-
createAttachmentPart
public javax.xml.soap.AttachmentPart createAttachmentPart(javax.activation.DataHandler dataHandler)
- Overrides:
createAttachmentPartin classjavax.xml.soap.SOAPMessage
-
getAttachments
public Iterator getAttachments()
- Specified by:
getAttachmentsin classjavax.xml.soap.SOAPMessage
-
getAttachments
public Iterator getAttachments(javax.xml.soap.MimeHeaders headers)
- Specified by:
getAttachmentsin classjavax.xml.soap.SOAPMessage
-
getContentDescription
public String getContentDescription()
- Specified by:
getContentDescriptionin classjavax.xml.soap.SOAPMessage
-
getMimeHeaders
public javax.xml.soap.MimeHeaders getMimeHeaders()
- Specified by:
getMimeHeadersin classjavax.xml.soap.SOAPMessage
-
getProperty
public Object getProperty(String property) throws javax.xml.soap.SOAPException
- 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
-
removeAllAttachments
public void removeAllAttachments()
- Specified by:
removeAllAttachmentsin classjavax.xml.soap.SOAPMessage
-
saveRequired
public boolean saveRequired()
- Specified by:
saveRequiredin classjavax.xml.soap.SOAPMessage
-
setContentDescription
public void setContentDescription(String description)
- Specified by:
setContentDescriptionin classjavax.xml.soap.SOAPMessage
-
setProperty
public void setProperty(String property, Object value) throws javax.xml.soap.SOAPException
- Overrides:
setPropertyin classjavax.xml.soap.SOAPMessage- Throws:
javax.xml.soap.SOAPException
-
writeTo
public void writeTo(OutputStream out) throws javax.xml.soap.SOAPException, IOException
- 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
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 javax.xml.soap.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 javax.xml.soap.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 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)
-
-