Web / Apache Axiom Interview questions
Describe the role of SOAPFactory in Axiom?
SOAPFactory extends OMFactory but is specialized for producing SOAP-correct object structures - SOAPEnvelope, SOAPHeader, SOAPBody, and SOAPFault - rather than arbitrary XML elements.
Axiom provides two concrete flavors, SOAP11Factory and SOAP12Factory, each of which bakes in the correct namespace URI and element structure for that SOAP version, so you don't have to hand-assemble the envelope namespace or fault structure yourself.
SOAPFactory factory = OMAbstractFactory.getSOAP12Factory(); SOAPEnvelope envelope = factory.getDefaultEnvelope(); SOAPBody body = envelope.getBody();
Using the wrong factory for the SOAP version you actually intend to speak is a common source of interoperability bugs - the resulting envelope would carry the wrong namespace URI, which most SOAP toolkits will reject outright rather than silently tolerate.
More Related questions...