blob: fb5fb2b518d1e012b7420b93648e373e875c015e [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<title>MessageFactory</title>
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="MessageFactory";
}
}
catch(err) {
}
//-->
var methods = {"i0":6,"i1":6,"i2":9,"i3":9};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../javax/xml/soap/DetailEntry.html" title="interface in javax.xml.soap"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../javax/xml/soap/MimeHeader.html" title="class in javax.xml.soap"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?javax/xml/soap/MessageFactory.html" target="_top">Frames</a></li>
<li><a href="MessageFactory.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">javax.xml.soap</div>
<h2 title="Class MessageFactory" class="title">Class MessageFactory</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>javax.xml.soap.MessageFactory</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>Direct Known Subclasses:</dt>
<dd><a href="../../../org/apache/openejb/server/webservices/saaj/MessageFactoryImpl.html" title="class in org.apache.openejb.server.webservices.saaj">MessageFactoryImpl</a></dd>
</dl>
<hr>
<br>
<pre>public abstract class <span class="typeNameLabel">MessageFactory</span>
extends java.lang.Object</pre>
<div class="block">A factory for creating <code>SOAPMessage</code> objects.
<P>
A SAAJ client can create a <code>MessageFactory</code> object
using the method <code>newInstance</code>, as shown in the following
lines of code.
<pre><code>
MessageFactory mf = MessageFactory.newInstance();
MessageFactory mf12 = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
</code></pre>
<P>
All <code>MessageFactory</code> objects, regardless of how they are
created, will produce <code>SOAPMessage</code> objects that
have the following elements by default:
<UL>
<LI>A <code>SOAPPart</code> object
<LI>A <code>SOAPEnvelope</code> object
<LI>A <code>SOAPBody</code> object
<LI>A <code>SOAPHeader</code> object
</UL>
In some cases, specialized MessageFactory objects may be obtained that produce messages
prepopulated with additional entries in the <code>SOAPHeader</code> object and the
<code>SOAPBody</code> object.
The content of a new <code>SOAPMessage</code> object depends on which of the two
<code>MessageFactory</code> methods is used to create it.
<UL>
<LI><code>createMessage()</code> <BR>
This is the method clients would normally use to create a request message.
<LI><code>createMessage(MimeHeaders, java.io.InputStream)</code> -- message has
content from the <code>InputStream</code> object and headers from the
<code>MimeHeaders</code> object <BR>
This method can be used internally by a service implementation to
create a message that is a response to a request.
</UL></div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.6</dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../javax/xml/soap/MessageFactory.html#MessageFactory--">MessageFactory</a></span>()</code>&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>abstract <a href="../../../javax/xml/soap/SOAPMessage.html" title="class in javax.xml.soap">SOAPMessage</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/xml/soap/MessageFactory.html#createMessage--">createMessage</a></span>()</code>
<div class="block">Creates a new <code>SOAPMessage</code> object with the default
<code>SOAPPart</code>, <code>SOAPEnvelope</code>, <code>SOAPBody</code>,
and <code>SOAPHeader</code> objects.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>abstract <a href="../../../javax/xml/soap/SOAPMessage.html" title="class in javax.xml.soap">SOAPMessage</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/xml/soap/MessageFactory.html#createMessage-javax.xml.soap.MimeHeaders-java.io.InputStream-">createMessage</a></span>(<a href="../../../javax/xml/soap/MimeHeaders.html" title="class in javax.xml.soap">MimeHeaders</a>&nbsp;headers,
java.io.InputStream&nbsp;in)</code>
<div class="block">Internalizes the contents of the given <code>InputStream</code> object into a
new <code>SOAPMessage</code> object and returns the <code>SOAPMessage</code>
object.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>static <a href="../../../javax/xml/soap/MessageFactory.html" title="class in javax.xml.soap">MessageFactory</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/xml/soap/MessageFactory.html#newInstance--">newInstance</a></span>()</code>
<div class="block">Creates a new <code>MessageFactory</code> object that is an instance
of the default implementation (SOAP 1.1).</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>static <a href="../../../javax/xml/soap/MessageFactory.html" title="class in javax.xml.soap">MessageFactory</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/xml/soap/MessageFactory.html#newInstance-java.lang.String-">newInstance</a></span>(java.lang.String&nbsp;protocol)</code>
<div class="block">Creates a new <code>MessageFactory</code> object that is an instance
of the specified implementation.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="MessageFactory--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>MessageFactory</h4>
<pre>public&nbsp;MessageFactory()</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="newInstance--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>newInstance</h4>
<pre>public static&nbsp;<a href="../../../javax/xml/soap/MessageFactory.html" title="class in javax.xml.soap">MessageFactory</a>&nbsp;newInstance()
throws <a href="../../../javax/xml/soap/SOAPException.html" title="class in javax.xml.soap">SOAPException</a></pre>
<div class="block">Creates a new <code>MessageFactory</code> object that is an instance
of the default implementation (SOAP 1.1).
This method uses the lookup procedure specified in <a href="../../../javax/xml/soap/package-summary.html"><code>javax.xml.soap</code></a> to locate and load the
<a href="../../../javax/xml/soap/MessageFactory.html" title="class in javax.xml.soap"><code>MessageFactory</code></a> class.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a new instance of a <code>MessageFactory</code></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../javax/xml/soap/SOAPException.html" title="class in javax.xml.soap">SOAPException</a></code> - if there was an error in creating the
default implementation of the
<code>MessageFactory</code>.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../javax/xml/soap/SAAJMetaFactory.html" title="class in javax.xml.soap"><code>SAAJMetaFactory</code></a></dd>
</dl>
</li>
</ul>
<a name="newInstance-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>newInstance</h4>
<pre>public static&nbsp;<a href="../../../javax/xml/soap/MessageFactory.html" title="class in javax.xml.soap">MessageFactory</a>&nbsp;newInstance(java.lang.String&nbsp;protocol)
throws <a href="../../../javax/xml/soap/SOAPException.html" title="class in javax.xml.soap">SOAPException</a></pre>
<div class="block">Creates a new <code>MessageFactory</code> object that is an instance
of the specified implementation. May be a dynamic message factory,
a SOAP 1.1 message factory, or a SOAP 1.2 message factory. A dynamic
message factory creates messages based on the MIME headers specified
as arguments to the <code>createMessage</code> method.
This method uses the SAAJMetaFactory to locate the implementation class
and create the MessageFactory instance.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>protocol</code> - a string constant representing the class of the
specified message factory implementation. May be
either <code>DYNAMIC_SOAP_PROTOCOL</code>,
<code>DEFAULT_SOAP_PROTOCOL</code> (which is the same
as) <code>SOAP_1_1_PROTOCOL</code>, or
<code>SOAP_1_2_PROTOCOL</code>.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a new instance of a <code>MessageFactory</code></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../javax/xml/soap/SOAPException.html" title="class in javax.xml.soap">SOAPException</a></code> - if there was an error in creating the
specified implementation of <code>MessageFactory</code>.</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.6, SAAJ 1.3</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../javax/xml/soap/SAAJMetaFactory.html" title="class in javax.xml.soap"><code>SAAJMetaFactory</code></a></dd>
</dl>
</li>
</ul>
<a name="createMessage--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>createMessage</h4>
<pre>public abstract&nbsp;<a href="../../../javax/xml/soap/SOAPMessage.html" title="class in javax.xml.soap">SOAPMessage</a>&nbsp;createMessage()
throws <a href="../../../javax/xml/soap/SOAPException.html" title="class in javax.xml.soap">SOAPException</a></pre>
<div class="block">Creates a new <code>SOAPMessage</code> object with the default
<code>SOAPPart</code>, <code>SOAPEnvelope</code>, <code>SOAPBody</code>,
and <code>SOAPHeader</code> objects. Profile-specific message factories
can choose to prepopulate the <code>SOAPMessage</code> object with
profile-specific headers.
<P>
Content can be added to this message's <code>SOAPPart</code> object, and
the message can be sent "as is" when a message containing only a SOAP part
is sufficient. Otherwise, the <code>SOAPMessage</code> object needs
to create one or more <code>AttachmentPart</code> objects and
add them to itself. Any content that is not in XML format must be
in an <code>AttachmentPart</code> object.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a new <code>SOAPMessage</code> object</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../javax/xml/soap/SOAPException.html" title="class in javax.xml.soap">SOAPException</a></code> - if a SOAP error occurs</dd>
<dd><code>java.lang.UnsupportedOperationException</code> - if the protocol of this
<code>MessageFactory</code> instance is <code>DYNAMIC_SOAP_PROTOCOL</code></dd>
</dl>
</li>
</ul>
<a name="createMessage-javax.xml.soap.MimeHeaders-java.io.InputStream-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>createMessage</h4>
<pre>public abstract&nbsp;<a href="../../../javax/xml/soap/SOAPMessage.html" title="class in javax.xml.soap">SOAPMessage</a>&nbsp;createMessage(<a href="../../../javax/xml/soap/MimeHeaders.html" title="class in javax.xml.soap">MimeHeaders</a>&nbsp;headers,
java.io.InputStream&nbsp;in)
throws java.io.IOException,
<a href="../../../javax/xml/soap/SOAPException.html" title="class in javax.xml.soap">SOAPException</a></pre>
<div class="block">Internalizes the contents of the given <code>InputStream</code> object into a
new <code>SOAPMessage</code> object and returns the <code>SOAPMessage</code>
object.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>in</code> - the <code>InputStream</code> object that contains the data
for a message</dd>
<dd><code>headers</code> - the transport-specific headers passed to the
message in a transport-independent fashion for creation of the
message</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a new <code>SOAPMessage</code> object containing the data from
the given <code>InputStream</code> object</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.io.IOException</code> - if there is a problem in reading data from
the input stream</dd>
<dd><code><a href="../../../javax/xml/soap/SOAPException.html" title="class in javax.xml.soap">SOAPException</a></code> - may be thrown if the message is invalid</dd>
<dd><code>java.lang.IllegalArgumentException</code> - if the <code>MessageFactory</code>
requires one or more MIME headers to be present in the
<code>headers</code> parameter and they are missing.
<code>MessageFactory</code> implementations for
<code>SOAP_1_1_PROTOCOL</code> or
<code>SOAP_1_2_PROTOCOL</code> must not throw
<code>IllegalArgumentException</code> for this reason.</dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../javax/xml/soap/DetailEntry.html" title="interface in javax.xml.soap"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../javax/xml/soap/MimeHeader.html" title="class in javax.xml.soap"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?javax/xml/soap/MessageFactory.html" target="_top">Frames</a></li>
<li><a href="MessageFactory.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>