javax.xml.soap
Class SOAPFactory
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.
abstract Detail | createDetail()- Creates a new Detail object which serves as a container for DetailEntry
objects.
|
abstract SOAPElement | createElement(String localName)- Creates a SOAPElement object initialized with the given local name.
|
abstract SOAPElement | createElement(String localName, String prefix, String uri)- Creates a new SOAPElement object with the given local name, prefix and
uri.
|
SOAPElement | createElement(QName qname)- Creates a SOAPElement object initialized with the given QName object.
|
abstract SOAPElement | createElement(Name name)- Creates a SOAPElement object initialized with the given Name object.
|
SOAPElement | createElement(Element domElement)- Creates a SOAPElement object from an existing DOM Element.
|
abstract SOAPFault | createFault()- Creates a new default SOAPFault object
|
abstract SOAPFault | createFault(String reasonText, QName faultCode)- Creates a new SOAPFault object initialized with the given reasonText and
faultCode
|
abstract Name | createName(String localName)- Creates a new Name object initialized with the given local name.
|
abstract Name | createName(String localName, String prefix, String uri)- Creates a new Name object initialized with the given local name, namespace
prefix, and namespace URI.
|
static SOAPFactory | newInstance()- Creates a new SOAPFactory object that is an instance of the default
implementation (SOAP 1.1), This method uses the following ordered lookup
procedure to determine the SOAPFactory implementation class to load: Use
the javax.xml.soap.SOAPFactory system property.
|
static SOAPFactory | newInstance(String 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.
|
clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait |
createDetail
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.
View More Examples of createElement(String localName)
1: import ;
2: import ;
3: import ;
4: ...
5:
6: SOAPFactory sf = SOAPFactory.newInstance();
7: SOAPElement root = sf.createElement("AuthorizationStatus","ns0","urn:CardService");
8: ...
9: SOAPElement token = sf.createElement("authorizationToken");
10: token.addTextNode(dao.authorizationToken);
11: ...
12: root.addChildElement(token);
13: SOAPElement authorized =sf.createElement("authorized");
View Full Code Here
1: import ;
2: import ;
3:
4: ...
5: {
6: private SOAPFactory factory;
7:
8: ...
9: {
10: SOAPFactory factory = getFactory();
11: SOAPElement element = null;
12: ...
13:
14: element = factory.createElement(elementName.getLocalPart(), prefix, ns);
View Full Code Here
createElement
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.
createElement
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.
View More Examples of createElement(QName qname)
1: import ;
2: import ;
3: import ;
4: ...
5:
6: SOAPFactory sf = SOAPFactory.newInstance();
7: SOAPElement root = sf.createElement("AuthorizationStatus","ns0","urn:CardService");
8: ...
9: SOAPElement token = sf.createElement("authorizationToken");
10: token.addTextNode(dao.authorizationToken);
11: ...
12: root.addChildElement(token);
13: SOAPElement authorized =sf.createElement("authorized");
View Full Code Here
1: import ;
2: import ;
3:
4: ...
5: {
6: private SOAPFactory factory;
7:
8: ...
9: {
10: SOAPFactory factory = getFactory();
11: SOAPElement element = null;
12: ...
13:
14: element = factory.createElement(elementName.getLocalPart(), prefix, ns);
View Full Code Here
createElement
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.
View More Examples of createElement(Name name)
1: import ;
2: import ;
3: import ;
4: ...
5:
6: SOAPFactory sf = SOAPFactory.newInstance();
7: SOAPElement root = sf.createElement("AuthorizationStatus","ns0","urn:CardService");
8: ...
9: SOAPElement token = sf.createElement("authorizationToken");
10: token.addTextNode(dao.authorizationToken);
11: ...
12: root.addChildElement(token);
13: SOAPElement authorized =sf.createElement("authorized");
View Full Code Here
1: import ;
2: import ;
3:
4: ...
5: {
6: private SOAPFactory factory;
7:
8: ...
9: {
10: SOAPFactory factory = getFactory();
11: SOAPElement element = null;
12: ...
13:
14: element = factory.createElement(elementName.getLocalPart(), prefix, ns);
View Full Code Here
createElement
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.
View More Examples of createElement(Element domElement)
1: import ;
2: import ;
3: import ;
4: ...
5:
6: SOAPFactory sf = SOAPFactory.newInstance();
7: SOAPElement root = sf.createElement("AuthorizationStatus","ns0","urn:CardService");
8: ...
9: SOAPElement token = sf.createElement("authorizationToken");
10: token.addTextNode(dao.authorizationToken);
11: ...
12: root.addChildElement(token);
13: SOAPElement authorized =sf.createElement("authorized");
View Full Code Here
1: import ;
2: import ;
3:
4: ...
5: {
6: private SOAPFactory factory;
7:
8: ...
9: {
10: SOAPFactory factory = getFactory();
11: SOAPElement element = null;
12: ...
13:
14: element = factory.createElement(elementName.getLocalPart(), prefix, ns);
View Full Code Here
createName
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.
View More Examples of createName(String localName)
1: import ;
2: import ;
3: import ;
4: ...
5:
6: SOAPFactory factory = SOAPFactory.newInstance();
7: Name rpcName = factory.createName("processDescrResponse", "ns1", TARGET_NAMESPACE);
8: ...
9: SOAPElement paramElement = (SOAPElement)rpcElement.getChildElements().next();
10: Name paramName = factory.createName("processDescrReturn");
11: if (paramName.equals(paramElement.getElementName()) == false)
View Full Code Here
1: import ;
2: import ;
3:
4: ...
5: {
6: SOAPFactory factory = SOAPFactory.newInstance();
7: assertEquals(org.jboss.ws.core.soap.SOAPFactoryImpl.class, factory.getClass());
8: ...
9: Detail el = factory.createDetail();
10: assertEquals(factory.createName("detail"), el.getElementName());
11: }
12: ...
13:
14: Name shortName = factory.createName("localName");
View Full Code Here
1: import ;
2: import ;
3: import ;
4: ...
5:
6: SOAPFactory factory = SOAPFactory.newInstance();
7: Name rpcName = factory.createName("echoUserType", "ns1", TARGET_NAMESPACE);
8: ...
9: SOAPElement paramElement = (SOAPElement)rpcElement.getChildElements().next();
10: Name paramName = factory.createName("UserType_1");
11: if (paramName.equals(paramElement.getElementName()) == false)
12: ...
13: SOAPElement paramElement = (SOAPElement)rpcElement.getChildElements().next();
14: Name paramName = factory.createName("result");
View Full Code Here
1: import ;
2: import ;
3: import ;
4: ...
5: SOAPMessage soapMessage = soapContext.getMessage();
6: SOAPFactory soapFactory = SOAPFactory.newInstance();
7:
8: ...
9: SOAPFactory soapFactory = SOAPFactory.newInstance();
10: SOAPElement utElement = (SOAPElement)element.getChildElements(soapFactory.createName(rootName)).next();
11:
12: ...
13: SOAPElement propC = (SOAPElement)it.next();
14: if (propC.getElementName().equals(soapFactory.createName("propC")) == false)
View Full Code Here
1: import ;
2: import ;
3:
4: ...
5: {
6: private SOAPFactory m_soap_factory;
7:
8: ...
9: {
10: m_soap_factory = SOAPFactory.newInstance( );
11: }
12: ...
13: detailEntry =
14: detail.addDetailEntry( m_soap_factory.createName( domElem.getLocalName( ),
View Full Code Here
createName
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.
newInstance
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 following ordered lookup
procedure to determine the SOAPFactory implementation class to load: Use
the javax.xml.soap.SOAPFactory system property. Use the properties file
"lib/jaxm.properties" in the JRE directory. This configuration file is in
standard java.util.Properties format and contains the fully qualified name
of the implementation class with the key being the system property defined
above. Use the Services API (as detailed in the JAR specification), if
available, to determine the classname. The Services API will look for a
classname in the file META-INF/services/javax.xml.soap.SOAPFactory in jars
available to the runtime. Use the SAAJMetaFactory instance to locate the
SOAPFactory implementation class.
View More Examples of newInstance()
1: import ;
2: import ;
3: import ;
4: ...
5: {
6: SOAPFactory factory = SOAPFactory.newInstance();
7: fault.setFaultActor("mr.actor");
8: fault.addDetail().addChildElement("test");
9: throw new SOAPFaultException(fault);
View Full Code Here
1: import ;
2: import ;
3: import ;
4: ...
5: {
6: SOAPFactory factory = SOAPFactory.newInstance();
7:
8: SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
9: SOAPBody soapBody = soapMessage.getSOAPBody();
View Full Code Here
1: import ;
2: import ;
3: import ;
4: ...
5:
6: SOAPFactory factory = SOAPFactory.newInstance();
7: Name rpcName = factory.createName("processDescrResponse", "ns1", TARGET_NAMESPACE);
8: if (rpcName.equals(rpcElement.getElementName()) == false)
9: throw new IllegalStateException("Invalid rpc name: " + rpcElement.getElementName());
View Full Code Here
1: import ;
2: import ;
3: import ;
4: ...
5: {
6: SOAPFactory factory = SOAPFactory.newInstance();
7:
8: SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
9: SOAPBody soapBody = soapMessage.getSOAPBody();
View Full Code Here
1: import ;
2: import ;
3:
4: ...
5: {
6: SOAPFactory factory = SOAPFactory.newInstance();
7: assertEquals(org.jboss.ws.core.soap.SOAPFactoryImpl.class, factory.getClass());
8: ...
9: {
10: SOAPFactory factory = SOAPFactory.newInstance();
11: Detail el = factory.createDetail();
12: ...
13: {
14: SOAPFactory factory = SOAPFactory.newInstance();
View Full Code Here
newInstance
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.
View More Examples of newInstance(String protocol)
1: private final String _protocol;
2: private final SOAPFactory _soapFactory;
3:
4: ...
5: _protocol = protocol;
6: _soapFactory = SOAPFactory.newInstance(protocol);
7: }
8: ...
9:
10: public SOAPFactory getSOAPFactory()
11: {
View Full Code Here
1: private final MessageFactory _messageFactory;
2: private final SOAPFactory _soapFactory;
3:
4: ...
5: if (bindingId.equals(SOAP11HTTP_BINDING)) {
6: _messageFactory = MessageFactory.newInstance(SOAP_1_1_PROTOCOL);
7: ...
8: _soapFactory = SOAPFactory.newInstance(SOAP_1_1_PROTOCOL);
9: _mtom = false;
10: ...
11: else if (bindingId.equals(SOAP11HTTP_MTOM_BINDING)) {
12: _messageFactory = MessageFactory.newInstance(SOAP_1_1_PROTOCOL);
View Full Code Here