Package org.apache.axiom.om.ds.custombuilder

Examples of org.apache.axiom.om.ds.custombuilder.ByteArrayCustomBuilder


        // Create a builder connected to the reader
        StAXBuilder builder = (StAXBuilder)OMXMLBuilderFactory.createStAXSOAPModelBuilder(
                reader);
       
        // Create a custom builder to store the sub trees as a byte array instead of a full tree
        ByteArrayCustomBuilder customBuilder = new ByteArrayCustomBuilder("utf-8");
       
        // Register the custom builder on the builder so that they body payload is stored as bytes
        builder.registerCustomBuilderForPayload(customBuilder);
       
       
View Full Code Here


        // Create a builder connected to the reader
        StAXBuilder builder = (StAXBuilder)OMXMLBuilderFactory.createStAXSOAPModelBuilder(
                reader);
       
        // Create a custom builder to store the sub trees as a byte array instead of a full tree
        ByteArrayCustomBuilder customBuilder = new ByteArrayCustomBuilder("utf-8");
       
        // Register the custom builder on the builder so that they body payload is stored as bytes
        builder.registerCustomBuilderForPayload(customBuilder);
       
       
View Full Code Here

        // Create a builder connected to the reader
        StAXBuilder builder = (StAXBuilder)OMXMLBuilderFactory.createStAXSOAPModelBuilder(
                reader);
       
        // Create a custom builder to store the sub trees as a byte array instead of a full tree
        ByteArrayCustomBuilder customBuilder = new ByteArrayCustomBuilder("utf-8");
       
        // Register the custom builder on the builder so that they body payload is stored as bytes
        builder.registerCustomBuilderForPayload(customBuilder);
       
       
View Full Code Here

        // not cause inteference with the custom builder processing
        envelope.getBody().hasFault();

        // Do the registration here...this simulates when it could occure in the engine
        // (After the fault check and during phase processing...probably dispatch phase)
        builder.registerCustomBuilderForPayload(new ByteArrayCustomBuilder("utf-8"));
       
        OMElement bodyElement = envelope.getBody().getFirstElement();
        assertTrue(bodyElement instanceof OMSourcedElement);
    }
View Full Code Here

   
    public void testHeaderCustomBuilder() throws Exception{
        XMLStreamReader parser =
                StAXUtils.createXMLStreamReader(getTestResource(TestConstants.SOAP_SOAPMESSAGE));
        StAXSOAPModelBuilder builder = new StAXSOAPModelBuilder(parser, null);
        builder.registerCustomBuilder(new QName("http://schemas.xmlsoap.org/ws/2004/03/addressing","To"), 3, new
                                      ByteArrayCustomBuilder("utf-8"));
        SOAPEnvelope sourceEnv = (SOAPEnvelope) builder.getDocumentElement();
        SOAPHeader header = sourceEnv.getHeader();
        ArrayList al =
            header.getHeaderBlocksWithNSURI("http://schemas.xmlsoap.org/ws/2004/03/addressing");
View Full Code Here

     * @throws Exception
     */
    protected SOAPEnvelope createEnvelope(InputStream in) throws Exception {
        XMLStreamReader parser = StAXUtils.createXMLStreamReader(in);
        StAXSOAPModelBuilder builder = new StAXSOAPModelBuilder(parser, null);
        builder.registerCustomBuilderForPayload(new ByteArrayCustomBuilder("utf-8"));
        return (SOAPEnvelope) builder.getDocumentElement();
    }
View Full Code Here

   
    public void testHeaderCustomBuilder() throws Exception{
        XMLStreamReader parser =
                StAXUtils.createXMLStreamReader(getTestResource(TestConstants.SOAP_SOAPMESSAGE));
        StAXSOAPModelBuilder builder = new StAXSOAPModelBuilder(parser, null);
        builder.registerCustomBuilder(new QName("http://schemas.xmlsoap.org/ws/2004/03/addressing","To"), 3, new
                                      ByteArrayCustomBuilder("utf-8"));
        SOAPEnvelope sourceEnv = (SOAPEnvelope) builder.getDocumentElement();
        SOAPHeader header = sourceEnv.getHeader();
        ArrayList al =
            header.getHeaderBlocksWithNSURI("http://schemas.xmlsoap.org/ws/2004/03/addressing");
View Full Code Here

            sourceEnv.getBody().hasFault();
        }
       
        // Do the registration here...this simulates when it could occure in the engine
        // (After the fault check and during phase processing...probably dispatch phase)
        builder.registerCustomBuilderForPayload(new ByteArrayCustomBuilder("utf-8"));
        return sourceEnv;
    }
View Full Code Here

        StAXBuilder builder = OMXMLBuilderFactory.createStAXSOAPModelBuilder(
                OMAbstractFactory.getSOAP11Factory(),
                reader);
       
        // Create a custom builder to store the sub trees as a byte array instead of a full tree
        ByteArrayCustomBuilder customBuilder = new ByteArrayCustomBuilder("utf-8");
       
        // Register the custom builder on the builder so that they body payload is stored as bytes
        builder.registerCustomBuilderForPayload(customBuilder);
       
       
View Full Code Here

        StAXBuilder builder = OMXMLBuilderFactory.createStAXSOAPModelBuilder(
                OMAbstractFactory.getSOAP11Factory(),
                reader);
       
        // Create a custom builder to store the sub trees as a byte array instead of a full tree
        ByteArrayCustomBuilder customBuilder = new ByteArrayCustomBuilder("utf-8");
       
        // Register the custom builder on the builder so that they body payload is stored as bytes
        builder.registerCustomBuilderForPayload(customBuilder);
       
       
View Full Code Here

TOP

Related Classes of org.apache.axiom.om.ds.custombuilder.ByteArrayCustomBuilder

Copyright © 2018 www.massapicom. 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.