Javax.xml.soap.SOAPFactory Class



Introduction

The javax.xml.soap.SOAPFactory class 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.A new SOAPMessage object contains the following by default:

  • A SOAPPart object

  • A SOAPEnvelope object

  • A SOAPBody object

  • A SOAPHeader object

Class declaration

Following is the declaration for javax.xml.soap.SOAPFactory class −

public abstract class SOAPFactory
   extends Object

Class constructors

S.N. Constructor & Description
1 SOAPFactory()

Single Constructor.

Class methods

S.N. Method & Description
1

abstract Detail createDetail()

This method creates a new detail object which serves as a container for DetailEntry objects.

2

SOAPElement createElement(Element domElement)

This method Creates a SOAPElement object from an existing DOM Element.

3

abstract SOAPElement createElement(Name name)

This method creates a SOAPElement object initialized with the given Name object.

4

SOAPElement createElement(QName qname)

This method creates a SOAPElement object initialized with the given QName object.

5

abstract SOAPElement createElement(String localName)

This method creates a SOAPElement object initialized with the given local name.

6

abstract SOAPElement createElement(String localName, String prefix, String uri)

This method creates a new SOAPElement object with the given local name, prefix and uri.

7

abstract SOAPFault createFault()

This method creates a new default SOAPFault object.

8

abstract SOAPFault createFault(String reasonText, QName faultCode)

This method creates a new SOAPFault object initialized with the given reasonText and faultCode.

9

abstract Name createName(String localName)

This method creates a new Name object initialized with the given local name.

10

abstract Name createName(String localName, String prefix, String uri)

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

11

static SOAPFactory newInstance()

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

12

static SOAPFactory newInstance(String protocol)

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

Methods inherited

This class inherits methods from the following classes −

javax.xml.Object

Advertisements