Top Description Fields Constructors Methods
javax.xml.soap

public abstract Class SOAPFactory

extends Object
Class Inheritance
Imports
javax.xml.namespace.QName, org.w3c.dom.Element

SOAPFactory is a factory for creating various objects that exist in the SOAP XML tree. SOAPFactory can be used to create XML fragments that will eventually end up in the SOAP part. These fragments can be inserted as children of the SOAPHeaderElement or SOAPBodyElement or SOAPEnvelope or other SOAPElement objects. SOAPFactory also has methods to create javax.xml.soap.Detail objects as well as java.xml.soap.Name objects.
Since
1.6

Field Summary

Modifier and TypeField and Description
private static final String
DEFAULT_SOAP_FACTORY

Class name of default SOAPFactory implementation.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public abstract Detail

Returns:

a Detail object
createDetail
()

Creates a new Detail object which serves as a container for DetailEntry objects.

public SOAPElement

Returns:

a new SOAPElement that is a copy of domElement.
createElement
(Element
the Element to be copied.
domElement
)

Creates a SOAPElement object from an existing DOM Element.

public abstract SOAPElement

Returns:

the new SOAPElement object that was created
createElement
(Name
a Name object with the XML name for the new element
name
)

Creates a SOAPElement object initialized with the given Name object.

public SOAPElement

Returns:

the new SOAPElement object that was created
createElement
(QName
a QName object with the XML name for the new element
qname
)

Creates a SOAPElement object initialized with the given QName object.

public abstract SOAPElement

Returns:

the new SOAPElement object that was created
createElement
(String
a String giving the local name for the new element
localName
)

Creates a SOAPElement object initialized with the given local name.

public abstract SOAPElement

Returns:

the new SOAPElement object that was created
createElement
(String
a String giving the local name for the new element
localName
,
String
the prefix for this SOAPElement
prefix
,
String
a String giving the URI of the namespace to which the new element belongs
uri
)

Creates a new SOAPElement object with the given local name, prefix and uri.

public abstract SOAPFault

Returns:

a SOAPFault object
createFault
(String
the ReasonText/FaultString for the fault
reasonText
,
QName
the FaultCode for the fault
faultCode
)

Creates a new SOAPFault object initialized with the given reasonText and faultCode

public abstract SOAPFault

Returns:

a SOAPFault object
createFault
()

Creates a new default SOAPFault object

public abstract Name

Returns:

a Name object initialized with the given local name, namespace prefix, and namespace URI
createName
(String
a String giving the local name
localName
,
String
a String giving the prefix of the namespace
prefix
,
String
a String giving the URI of the namespace
uri
)

Creates a new Name object initialized with the given local name, namespace prefix, and namespace URI.

public abstract Name

Returns:

a Name object initialized with the given local name
createName
(String
a String giving the local name
localName
)

Creates a new Name object initialized with the given local name.

public static SOAPFactory

Returns:

a new instance of a SOAPFactory
newInstance
()

Creates a new SOAPFactory object that is an instance of the default implementation (SOAP 1.1).

public static SOAPFactory

Returns:

a new instance of a SOAPFactory
newInstance
(String
a string constant representing the protocol of the specified SOAP factory implementation. May be either DYNAMIC_SOAP_PROTOCOL, DEFAULT_SOAP_PROTOCOL (which is the same as) SOAP_1_1_PROTOCOL, or SOAP_1_2_PROTOCOL.
protocol
)

Creates a new SOAPFactory object that is an instance of the specified implementation, this method uses the SAAJMetaFactory to locate the implementation class and create the SOAPFactory instance.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULT_SOAP_FACTORYback to summary
private static final String DEFAULT_SOAP_FACTORY

Class name of default SOAPFactory implementation.

Constructor Detail

SOAPFactoryback to summary
public SOAPFactory()

Method Detail

createDetailback to summary
public abstract Detail createDetail() throws SOAPException

Creates a new Detail object which serves as a container for DetailEntry objects.

This factory method creates Detail objects for use in situations where it is not practical to use the SOAPFault abstraction.

Returns:Detail

a Detail object

Exceptions
SOAPException:
if there is a SOAP error
UnsupportedOperationException:
if the protocol specified for the SOAPFactory was DYNAMIC_SOAP_PROTOCOL
createElementback to summary
public SOAPElement createElement(Element domElement) throws SOAPException

Creates a SOAPElement object from an existing DOM Element. If the DOM Element that is passed in as an argument is already a SOAPElement then this method must return it unmodified without any further work. Otherwise, a new SOAPElement is created and a deep copy is made of the domElement argument. The concrete type of the return value will depend on the name of the domElement argument. If any part of the tree rooted in domElement violates SOAP rules, a SOAPException will be thrown.

Parameters
domElement:Element

the Element to be copied.

Returns:SOAPElement

a new SOAPElement that is a copy of domElement.

Exceptions
SOAPException:
if there is an error in creating the SOAPElement object
Since
1.6, SAAJ 1.3
createElementback to summary
public abstract SOAPElement createElement(Name name) throws SOAPException

Creates a SOAPElement object initialized with the given Name object. The concrete type of the return value will depend on the name given to the new SOAPElement. For instance, a new SOAPElement with the name "{http://www.w3.org/2003/05/soap-envelope}Envelope" would cause a SOAPEnvelope that supports SOAP 1.2 behavior to be created.

Parameters
name:Name

a Name object with the XML name for the new element

Returns:SOAPElement

the new SOAPElement object that was created

Exceptions
SOAPException:
if there is an error in creating the SOAPElement object
See Also
SOAPFactory#createElement(javax.xml.namespace.QName)
createElementback to summary
public SOAPElement createElement(QName qname) throws SOAPException

Creates a SOAPElement object initialized with the given QName object. The concrete type of the return value will depend on the name given to the new SOAPElement. For instance, a new SOAPElement with the name "{http://www.w3.org/2003/05/soap-envelope}Envelope" would cause a SOAPEnvelope that supports SOAP 1.2 behavior to be created.

Parameters
qname:QName

a QName object with the XML name for the new element

Returns:SOAPElement

the new SOAPElement object that was created

Exceptions
SOAPException:
if there is an error in creating the SOAPElement object
Since
1.6, SAAJ 1.3
See Also
SOAPFactory#createElement(Name)
createElementback to summary
public abstract SOAPElement createElement(String localName) throws SOAPException

Creates a SOAPElement object initialized with the given local name.

Parameters
localName:String

a String giving the local name for the new element

Returns:SOAPElement

the new SOAPElement object that was created

Exceptions
SOAPException:
if there is an error in creating the SOAPElement object
createElementback to summary
public abstract SOAPElement createElement(String localName, String prefix, String uri) throws SOAPException

Creates a new SOAPElement object with the given local name, prefix and uri. The concrete type of the return value will depend on the name given to the new SOAPElement. For instance, a new SOAPElement with the name "{http://www.w3.org/2003/05/soap-envelope}Envelope" would cause a SOAPEnvelope that supports SOAP 1.2 behavior to be created.

Parameters
localName:String

a String giving the local name for the new element

prefix:String

the prefix for this SOAPElement

uri:String

a String giving the URI of the namespace to which the new element belongs

Returns:SOAPElement

the new SOAPElement object that was created

Exceptions
SOAPException:
if there is an error in creating the SOAPElement object
createFaultback to summary
public abstract SOAPFault createFault(String reasonText, QName faultCode) throws SOAPException

Creates a new SOAPFault object initialized with the given reasonText and faultCode

Parameters
reasonText:String

the ReasonText/FaultString for the fault

faultCode:QName

the FaultCode for the fault

Returns:SOAPFault

a SOAPFault object

Exceptions
SOAPException:
if there is a SOAP error
Since
1.6, SAAJ 1.3
createFaultback to summary
public abstract SOAPFault createFault() throws SOAPException

Creates a new default SOAPFault object

Returns:SOAPFault

a SOAPFault object

Exceptions
SOAPException:
if there is a SOAP error
Since
1.6, SAAJ 1.3
createNameback to summary
public abstract Name createName(String localName, String prefix, String uri) throws SOAPException

Creates a new Name object initialized with the given local name, namespace prefix, and namespace URI.

This factory method creates Name objects for use in situations where it is not practical to use the SOAPEnvelope abstraction.

Parameters
localName:String

a String giving the local name

prefix:String

a String giving the prefix of the namespace

uri:String

a String giving the URI of the namespace

Returns:Name

a Name object initialized with the given local name, namespace prefix, and namespace URI

Exceptions
SOAPException:
if there is a SOAP error
createNameback to summary
public abstract Name createName(String localName) throws SOAPException

Creates a new Name object initialized with the given local name.

This factory method creates Name objects for use in situations where it is not practical to use the SOAPEnvelope abstraction.

Parameters
localName:String

a String giving the local name

Returns:Name

a Name object initialized with the given local name

Exceptions
SOAPException:
if there is a SOAP error
newInstanceback to summary
public static SOAPFactory newInstance() throws SOAPException

Creates a new SOAPFactory object that is an instance of the default implementation (SOAP 1.1). This method uses the lookup procedure specified in javax.xml.soap to locate and load the javax.xml.soap.SOAPFactory class.

Returns:SOAPFactory

a new instance of a SOAPFactory

Exceptions
SOAPException:
if there was an error creating the default SOAPFactory
See Also
SAAJMetaFactory
newInstanceback to summary
public static SOAPFactory newInstance(String protocol) throws SOAPException

Creates a new SOAPFactory object that is an instance of the specified implementation, this method uses the SAAJMetaFactory to locate the implementation class and create the SOAPFactory instance.

Parameters
protocol:String

a string constant representing the protocol of the specified SOAP factory implementation. May be either DYNAMIC_SOAP_PROTOCOL, DEFAULT_SOAP_PROTOCOL (which is the same as) SOAP_1_1_PROTOCOL, or SOAP_1_2_PROTOCOL.

Returns:SOAPFactory

a new instance of a SOAPFactory

Exceptions
SOAPException:
if there was an error creating the specified SOAPFactory
Since
1.6, SAAJ 1.3
See Also
SAAJMetaFactory