Examples of serializeAndConsume()


Examples of org.apache.axiom.soap.SOAPEnvelope.serializeAndConsume()

        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
        writer = StAXUtils.createXMLStreamWriter(byteArrayOutputStream,
                OMConstants.DEFAULT_CHAR_SET_ENCODING);

        SOAPEnvelope env = (SOAPEnvelope) builder.getDocumentElement();
        env.serializeAndConsume(writer);
        writer.flush();

        String outputString = new String(byteArrayOutputStream.toByteArray());
        assertTrue(outputString != null && !"".equals(outputString) && outputString.length() > 1);
View Full Code Here

Examples of org.apache.axiom.soap.SOAPEnvelope.serializeAndConsume()

        StringWriter stringWriter = new StringWriter();

        //now we should not be able to serilaize anything ! this should throw
        //an error
        try {
            env.serializeAndConsume(writer);
            fail();
        } catch (UnsupportedOperationException e) {
            e.printStackTrace(new PrintWriter(stringWriter, true));
            assertTrue(stringWriter.toString()
                                   .indexOf("The parser is already consumed!") > -1);
View Full Code Here

Examples of org.apache.axiom.soap.SOAPEnvelope.serializeAndConsume()

        SOAPEnvelope envelope = axiomMessage.getSOAPEnvelope();
        if (payloadCaching) {
            envelope.serialize(writer, format);
        }
        else {
            envelope.serializeAndConsume(writer, format);
        }

      try {
        OMMultipartWriter mpw = new OMMultipartWriter(outputStream, format);
View Full Code Here

Examples of org.apache.axiom.soap.SOAPEnvelope.serializeAndConsume()

                factory.createOMElement("AuthnContextClassRef", saml,
                                        authnContext);
            authnContextClassRef.setText("urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport");
        }

        soapEnvelope.serializeAndConsume(writer);
    }

    /**
     * Gets the user's Distinguished Name (DN)
     *
 
View Full Code Here

Examples of org.apache.axiom.soap.SOAPEnvelope.serializeAndConsume()

                factory.createOMElement("Action", saml, authzDecisionStatement);
            action.addAttribute("Namespace", query.getActionNamespace(), null);
            action.setText(query.getAction());
        }

        soapEnvelope.serializeAndConsume(writer);
    }

    /**
     * Checks the Object is not null
     *
 
View Full Code Here

Examples of org.apache.axiom.soap.SOAPEnvelope.serializeAndConsume()

        writer =
                XMLOutputFactory.newInstance().
                        createXMLStreamWriter(byteArrayOutputStream);

        SOAPEnvelope env = (SOAPEnvelope) soapBuilder.getDocumentElement();
        env.serializeAndConsume(writer);
        writer.flush();

        String outputString = new String(byteArrayOutputStream.toByteArray());
        assertTrue(outputString != null && !"".equals(outputString) && outputString.length() > 1);
View Full Code Here

Examples of org.apache.axiom.soap.SOAPEnvelope.serializeAndConsume()

        StringWriter stringWriter = new StringWriter();

        //now we should not be able to serilaize anything ! this should throw
        //an error
        try {
            env.serializeAndConsume(writer);
            fail();
        } catch (XMLStreamException e) {
            e.printStackTrace(new PrintWriter(stringWriter, true));
            assertTrue(stringWriter.toString().indexOf("problem accessing the parser. Parser already accessed!") > -1);
        } catch (Exception e) {
View Full Code Here

Examples of org.apache.axiom.soap.SOAPEnvelope.serializeAndConsume()

        OMXMLParserWrapper builder = OMXMLBuilderFactory.createStAXSOAPModelBuilder(
                OMAbstractFactory.getSOAP11Factory(),
                reader);

        SOAPEnvelope env = (SOAPEnvelope) builder.getDocumentElement();
        env.serializeAndConsume(writer);
        writer.flush();

        //now we should not be able to serilaize anything ! this should throw
        //an error
        try {
View Full Code Here

Examples of org.apache.axiom.soap.SOAPEnvelope.serializeAndConsume()

        writer.flush();

        //now we should not be able to serilaize anything ! this should throw
        //an error
        try {
           env.serializeAndConsume(writer);
           fail();
        } catch (XMLStreamException e) {
           assertTrue(true);
        } catch (Exception e) {
           assertTrue(true);
View Full Code Here

Examples of org.apache.axiom.soap.SOAPEnvelope.serializeAndConsume()

    StAXSOAPModelBuilder sob = new StAXSOAPModelBuilder(parser, null);
    SOAPEnvelope se = (SOAPEnvelope)sob.getDocumentElement();
    SOAPHeader sh = se.getHeader();
        sh.build();
    StringWriter sw = new StringWriter();
    se.serializeAndConsume(sw);

    checkBodyExists(sw.toString());
  }

    public void testBodyPreservedSerializeAndConsumeAsXML() throws Exception{
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.