Examples of SOAPFactory


Examples of org.apache.axiom.soap.SOAPFactory

        assertTrue("Conversion failed", xml.indexOf("</RequestSecurityToken>") != -1);
    }

    public void testConvert1() {
        SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();
        SOAPEnvelope env = fac.getDefaultEnvelope();
        fac.createOMElement(new QName("http://test.org", "Test"), env.getBody());
        env.build();

        SOAPModelBuilder doomBuilder = OMXMLBuilderFactory.createStAXSOAPModelBuilder(
                OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM),
                env.getXMLStreamReader());
View Full Code Here

Examples of org.apache.axiom.soap.SOAPFactory

        doomEnv.build();
    }

    public void testAddChild() {
        SOAPFactory fac = OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM).getSOAP11Factory();
        SOAPEnvelope env = fac.getDefaultEnvelope();
        fac.createOMElement(new QName("http://test.org", "Test"), env.getBody());
        env.build();

        SOAPFactory llomFac = OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM).getSOAP11Factory();
        OMElement elem = llomFac.createOMElement("newDomElement", null);

        OMElement firstElement = env.getBody().getFirstElement();
        firstElement.addChild(elem);

        assertTrue("New DOM child missing",
View Full Code Here

Examples of org.apache.axiom.soap.SOAPFactory

                    }
                }

                // Check the namespace and find SOAP version and factory
                String nsURI = null;
                SOAPFactory factory;
                if (env.getNamespace().getNamespaceURI().equals(
                        SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI)) {
                    nsURI = SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI;
                    factory = DOOMAbstractFactory.getSOAP11Factory();
                } else {
                    nsURI = SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI;
                    factory = DOOMAbstractFactory.getSOAP12Factory();
                }

                StAXSOAPModelBuilder stAXSOAPModelBuilder = new StAXSOAPModelBuilder(
                        env.getXMLStreamReader(), factory, nsURI);
                SOAPEnvelope envelope = (stAXSOAPModelBuilder)
                        .getSOAPEnvelope();
                ((OMNode) envelope.getParent()).build();
               
                //Set the processed flag of the processed headers
                SOAPHeader header = envelope.getHeader();
                for (Iterator iter = processedHeaderQNames.iterator(); iter
                        .hasNext();) {
                    QName name = (QName) iter.next();
                    Iterator omKids = header.getChildrenWithName(name);
                    if(omKids.hasNext()) {
                        ((SOAPHeaderBlock)omKids.next()).setProcessed();
                    }
                }
               
                Element envElem = (Element) envelope;
                return envElem.getOwnerDocument();
            } else {
                ByteArrayOutputStream baos = new ByteArrayOutputStream();
                env.build();
                env.serialize(baos);
                ByteArrayInputStream bais = new ByteArrayInputStream(baos
                        .toByteArray());
                DocumentBuilderFactory factory = DocumentBuilderFactory
                        .newInstance();
                factory.setNamespaceAware(true);
                return factory.newDocumentBuilder().parse(bais);
            }
    } catch (Exception e) {
      throw new WSSecurityException(
          "Error in converting SOAP Envelope to Document", e);
    }
View Full Code Here

Examples of org.apache.axiom.soap.SOAPFactory

    }

    @Test
    public void testAxiomResponse() throws Exception {
        Transformer transformer = TransformerFactory.newInstance().newTransformer();
        SOAPFactory axiomFactory = OMAbstractFactory.getSOAP11Factory();
        AxiomSoapMessage request = new AxiomSoapMessage(axiomFactory);
        transformer.transform(new StringSource(REQUEST), request.getPayloadResult());
        AxiomSoapMessageFactory soapMessageFactory = new AxiomSoapMessageFactory();
        soapMessageFactory.afterPropertiesSet();
        MessageContext context = new DefaultMessageContext(request, soapMessageFactory);
View Full Code Here

Examples of org.apache.axiom.soap.SOAPFactory

    }

    @Test
    public void testAxiomNoResponse() throws Exception {
        Transformer transformer = TransformerFactory.newInstance().newTransformer();
        SOAPFactory axiomFactory = OMAbstractFactory.getSOAP11Factory();
        AxiomSoapMessage request = new AxiomSoapMessage(axiomFactory);
        transformer.transform(new StringSource(REQUEST), request.getPayloadResult());
        AxiomSoapMessageFactory soapMessageFactory = new AxiomSoapMessageFactory();
        soapMessageFactory.afterPropertiesSet();
        MessageContext context = new DefaultMessageContext(request, soapMessageFactory);
View Full Code Here

Examples of org.apache.axiom.soap.SOAPFactory

    }

    @Test
    public void testAxiomResponseNoPayloadCaching() throws Exception {
        Transformer transformer = TransformerFactory.newInstance().newTransformer();
        SOAPFactory axiomFactory = OMAbstractFactory.getSOAP11Factory();
        AxiomSoapMessage request = new AxiomSoapMessage(axiomFactory);
        transformer.transform(new StringSource(REQUEST), request.getPayloadResult());
        AxiomSoapMessageFactory soapMessageFactory = new AxiomSoapMessageFactory();
        soapMessageFactory.setPayloadCaching(false);
        soapMessageFactory.afterPropertiesSet();
View Full Code Here

Examples of org.apache.axiom.soap.SOAPFactory

    }

    @Test
    public void testAxiomNoResponseNoPayloadCaching() throws Exception {
        Transformer transformer = TransformerFactory.newInstance().newTransformer();
        SOAPFactory axiomFactory = OMAbstractFactory.getSOAP11Factory();
        AxiomSoapMessage request = new AxiomSoapMessage(axiomFactory);
        transformer.transform(new StringSource(REQUEST), request.getPayloadResult());
        AxiomSoapMessageFactory soapMessageFactory = new AxiomSoapMessageFactory();
        soapMessageFactory.setPayloadCaching(false);
        soapMessageFactory.afterPropertiesSet();
View Full Code Here

Examples of org.apache.axiom.soap.SOAPFactory

        MockWebServiceMessage request = new MockWebServiceMessage(new StringSource(XML));
        return new DefaultMessageContext(request, new MockWebServiceMessageFactory());
    }

    protected MessageContext createCachingAxiomMessageContext() throws Exception {
        SOAPFactory axiomFactory = OMAbstractFactory.getSOAP11Factory();
        AxiomSoapMessage request = new AxiomSoapMessage(axiomFactory, true, false);
        transform(new StringSource(XML), request.getPayloadResult());
        AxiomSoapMessageFactory soapMessageFactory = new AxiomSoapMessageFactory();
        soapMessageFactory.afterPropertiesSet();
        return new DefaultMessageContext(request, soapMessageFactory);
View Full Code Here

Examples of org.apache.axiom.soap.SOAPFactory

        soapMessageFactory.afterPropertiesSet();
        return new DefaultMessageContext(request, soapMessageFactory);
    }

    protected MessageContext createNonCachingAxiomMessageContext() throws Exception {
        SOAPFactory axiomFactory = OMAbstractFactory.getSOAP11Factory();
        AxiomSoapMessage request = new AxiomSoapMessage(axiomFactory, false, false);
        transform(new StringSource(XML), request.getPayloadResult());
        AxiomSoapMessageFactory soapMessageFactory = new AxiomSoapMessageFactory();
        soapMessageFactory.setPayloadCaching(false);
        soapMessageFactory.afterPropertiesSet();
View Full Code Here

Examples of org.apache.axiom.soap.SOAPFactory

   */
  private byte[] getMessageAsBytes() throws Exception
  {
    String to = "http://127.0.0.1:" + serverPort + "/axis2/services/RMSampleService";

    SOAPFactory factory = new SOAP11Factory();
    SOAPEnvelope dummyEnvelope = factory.getDefaultEnvelope();
   
    // Create a "new" application message
    MessageContext messageContext = new MessageContext();
    messageContext.setConfigurationContext(serverConfigContext);
    messageContext.setAxisService(serverConfigContext.getAxisConfiguration().getService("RMSampleService"));   
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.