Skip navigation links

Oracle Security Developer Tools XML Security Java API Reference
11g (11.1.1)

E10680-02


oracle.security.xmlsec.util
Class SOAPMessageUtils

java.lang.Object
  extended by oracle.security.xmlsec.util.SOAPMessageUtils


public class SOAPMessageUtils
extends java.lang.Object

Utilities to work with SOAPMessage.
Note: These utilities could have been in XMLUtils as well, but to prevent non SOAP users from depending on saaj-api.jar, mail.jar and activation.jar, these utility functions have been separated out.


Nested Class Summary
static class SOAPMessageUtils.ByteArrayDataSource
           

 

Constructor Summary
SOAPMessageUtils()
           

 

Method Summary
static org.w3c.dom.Element addChildElementWithBinaryContent(org.w3c.dom.Element parent, java.lang.String localName, java.lang.String prefix, java.lang.String uri, byte[] value, boolean useLineBreaks)
          MTOM aware method to create a child Element under the parent Element with the specified prefix, localname and uri, and create a text node under the child element containing the byte array as a base 64 encoded string.
static java.io.InputStream getBinaryContentForChildElement(org.w3c.dom.Element elem)
           
static javax.xml.soap.MimeHeaders readHeaders(java.io.InputStream is)
          Read the Mime headers and position the InputStrea to just after the headers
static void writeTo(javax.xml.soap.SOAPMessage msg, java.io.OutputStream out)
          Wrapper over SOAPMessage.writeTo(OutputStream) to write out the headers as well as the body.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

SOAPMessageUtils

public SOAPMessageUtils()

Method Detail

addChildElementWithBinaryContent

public static org.w3c.dom.Element addChildElementWithBinaryContent(org.w3c.dom.Element parent,
                                                                   java.lang.String localName,
                                                                   java.lang.String prefix,
                                                                   java.lang.String uri,
                                                                   byte[] value,
                                                                   boolean useLineBreaks)
                                                            throws org.w3c.dom.DOMException
MTOM aware method to create a child Element under the parent Element with the specified prefix, localname and uri, and create a text node under the child element containing the byte array as a base 64 encoded string.
If the parent.getOwnerDocument().getDocumentElement() is an Oracle SAAJ object i.e. className startsWith oracle.j2ee.ws.saaj, then this method does't use DOM to create the child Element but instead uses SOAPElement.addChildElement() to create the element and then calls OracleSOAPElement.setDataHandler to set the bytes into it.
Parameters:
parent -
localName -
prefix -
uri -
value -
Returns:
Throws:
org.w3c.dom.DOMException

getBinaryContentForChildElement

public static java.io.InputStream getBinaryContentForChildElement(org.w3c.dom.Element elem)

writeTo

public static void writeTo(javax.xml.soap.SOAPMessage msg,
                           java.io.OutputStream out)
                    throws java.io.IOException,
                           javax.xml.soap.SOAPException
Wrapper over SOAPMessage.writeTo(OutputStream) to write out the headers as well as the body.
Parameters:
msg - The SOAPMessage that needs to be written out
out - where it is to be written
Throws:
java.io.IOException
javax.xml.soap.SOAPException

readHeaders

public static javax.xml.soap.MimeHeaders readHeaders(java.io.InputStream is)
                                              throws java.io.IOException
Read the Mime headers and position the InputStrea to just after the headers
Parameters:
is -
Returns:
Throws:
java.io.IOException

Skip navigation links

Oracle Security Developer Tools XML Security Java API Reference
11g (11.1.1)

E10680-02


Copyright © 2005, 2009, Oracle. All rights reserved.