@Override public SOAPFactory getSOAPFactory(OMMetaFactory metaFactory) { return metaFactory.getSOAP12Factory(); }
@Override public SOAPFactory getSOAPFactory(OMMetaFactory metaFactory) { return metaFactory.getSOAP12Factory(); }
/** * Get the default SOAP 1.2 OM factory instance. This method has the same effect as calling * {@link OMMetaFactory#getSOAP12Factory()} on the {@link OMMetaFactory} instance returned by * {@link #getMetaFactory()}. * * @return the default SOAP 1.2 OM factory instance * @throws OMException if the factory's implementation class can't be found * or if the class can't be instantiated */ public static SOAPFactory getSOAP12Factory() { return getMetaFactory().getSOAP12Factory(); } }
/** * Create a new <code>SOAPEnvelope</code> of the same version as the * SOAPEnvelope in the given <code>MessageContext</code> * * @param nsUri * @return SOAPEnvelope */ public static SOAPEnvelope createSOAPEnvelope(String nsUri) { OMMetaFactory domFac = OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM); if (nsUri != null && SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(nsUri)) { return domFac.getSOAP11Factory().getDefaultEnvelope(); } else { return domFac.getSOAP12Factory().getDefaultEnvelope(); } }
SOAPEnvelope soapEnvelope; if (soapVersion.equals(SOAPConstants.SOAP_1_2_PROTOCOL)) { soapEnvelope = metaFactory.getSOAP12Factory().getDefaultEnvelope(); } else if (soapVersion.equals(SOAPConstants.DYNAMIC_SOAP_PROTOCOL)) { throw new UnsupportedOperationException("createMessage() is not supported for " +
SOAPEnvelope soapEnvelope; if (soapVersion.equals(SOAPConstants.SOAP_1_2_PROTOCOL)) { soapEnvelope = metaFactory.getSOAP12Factory().getDefaultEnvelope(); } else if (soapVersion.equals(SOAPConstants.DYNAMIC_SOAP_PROTOCOL)) { throw new UnsupportedOperationException("createMessage() is not supported for " +
/** * Create a DOM Document using the org.apache.axiom.soap.SOAPEnvelope * * @param env An org.apache.axiom.soap.SOAPEnvelope instance * @return the DOM Document of the given SOAP Envelope */ public static Document getDocumentFromSOAPEnvelope(org.apache.axiom.soap.SOAPEnvelope env) { env.build(); //Check the namespace and find SOAP version and factory String nsURI; OMMetaFactory metaFactory = OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM); SOAPFactory factory; if (env.getNamespace().getNamespaceURI() .equals(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI)) { nsURI = SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI; factory = metaFactory.getSOAP11Factory(); } else { nsURI = SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI; factory = metaFactory.getSOAP12Factory(); } StAXSOAPModelBuilder stAXSOAPModelBuilder = new StAXSOAPModelBuilder(env.getXMLStreamReader(), factory, nsURI); SOAPEnvelope envelope = (stAXSOAPModelBuilder).getSOAPEnvelope(); envelope.build(); Element envElem = (Element)envelope; return envElem.getOwnerDocument(); }
} else { nsURI = SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI; factory = metaFactory.getSOAP12Factory();
if (soapFactory == null) { if (SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(namespaceURI)) { soapFactory = (SOAPFactoryEx)metaFactory.getSOAP12Factory(); log.debug("Starting to process SOAP 1.2 message"); } else if (SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(namespaceURI)) {
soapFactory = metaFactory.getSOAP11Factory(); } else if (type.equals(SOAPVersion.SOAP12.getMediaType())) { soapFactory = metaFactory.getSOAP12Factory(); } else { throw new OMException("Unable to determine SOAP version");
soapFactory = metaFactory.getSOAP11Factory(); } else if (soapContentType.equals(MediaType.APPLICATION_SOAP_XML)) { soapFactory = metaFactory.getSOAP12Factory(); } else { throw new SOAPException("Unrecognized content type '" + soapContentType + "'");
} else if (soapContentType.equals(MediaType.APPLICATION_SOAP_XML)) { soapEnvelopeNamespaceURI = SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI; soapFactory = metaFactory.getSOAP12Factory(); } else { throw new SOAPException("Unrecognized content type '" + soapContentType + "'");