SOAPEnv { public static org.apache.axiom.soap.SOAPEnvelope createEnvelope(final SOAPVersion v) { SOAPFactory omFactory = null; if (v == SOAPVersion.SOAP_11) { omFactory = OMAbstractFactory.getSOAP11Factory(); } else { omFactory = OMAbstractFactory.getSOAP12Factory(); } final org.apache.axiom.soap.SOAPEnvelope envelope = omFactory.getDefaultEnvelope(); declareNamespaces(envelope); return envelope; }  static org.apache.axiom.soap.SOAPEnvelope createEnvelope(final SOAPVersion v); static void declareNamespaces(final SOAPEnvelope envelope); static OMNamespace getEbms3Namespace(final OMElement e); static boolean isEbms3Message(final SOAPEnvelope env);  }
@Test public void testCreateEnvelope() throws Exception { SOAPEnvelope env = SOAPEnv.createEnvelope(SOAPEnv.SOAPVersion.SOAP_12); Iterator<OMNamespace> it = env.getNamespacesInScope(); HashSet<String> prefixSet = new HashSet<>(); while (it.hasNext()) { OMNamespace omNamespace = it.next(); String prefix = omNamespace.getPrefix(); prefixSet.add(prefix); String uri = omNamespace.getNamespaceURI(); if (prefix.equals("soapenv")) { assertTrue(uri.equals("http: } else if (prefix.equals(EbMSConstants.EBMS3_NS_PREFIX)) { assertTrue(uri.equals(EbMSConstants.EBMS3_NS_URI)); } else if (prefix.equals("xsd")) { assertTrue(uri.equals("http: } else if (prefix.equals("xsi")) { assertTrue(uri.equals("http: } } assertTrue(prefixSet.contains("soapenv")); assertTrue(prefixSet.contains(EbMSConstants.EBMS3_NS_PREFIX)); assertTrue(prefixSet.contains("xsd")); assertTrue(prefixSet.contains("xsi")); }