Package org.apache.axis2.soap.impl.llom.builder

Examples of org.apache.axis2.soap.impl.llom.builder.StAXSOAPModelBuilder


        envelope = soapFactory.getDefaultEnvelope();
        envelope.getBody().addChild(builder.getDocumentElement());
      } else {
        XMLStreamReader xmlreader = XMLInputFactory.newInstance()
            .createXMLStreamReader(inStream, charSetEnc);
        builder = new StAXSOAPModelBuilder(xmlreader, soapNamespaceURI);
        envelope = (SOAPEnvelope) builder.getDocumentElement();
      }
      return envelope;
    } catch (Exception e) {
      throw new AxisFault(e);
View Full Code Here


            fileName = IN_FILE_NAME;
        }
        XMLStreamReader parser = XMLInputFactory.newInstance()
                .createXMLStreamReader(
                        new FileReader(getTestResourceFile(fileName)));
        builder = new StAXSOAPModelBuilder(parser, null);
        return builder;
    }
View Full Code Here

    }

    protected StAXSOAPModelBuilder getOMBuilder(InputStream in) throws Exception {
        XMLStreamReader parser = XMLInputFactory.newInstance()
                .createXMLStreamReader(in);
        builder = new StAXSOAPModelBuilder(parser, null);
        return builder;
    }
View Full Code Here

    protected void setUp() throws Exception {
        File file = getTestResourceFile("soap/sample1.xml");
        XMLStreamReader parser = XMLInputFactory.newInstance()
                .createXMLStreamReader(new FileReader(file));
        fac = OMAbstractFactory.getSOAP11Factory();
        OMXMLParserWrapper builder = new StAXSOAPModelBuilder(parser, null);
        envelope = (SOAPEnvelope) builder.getDocumentElement();
    }
View Full Code Here

        XMLStreamReader xmlStreamReader = XMLInputFactory.newInstance().
                createXMLStreamReader(
                        new FileReader(
                                getTestResourceFile("soap/soapmessage1.xml")));
        SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
        builder = new StAXSOAPModelBuilder(xmlStreamReader, null);
        envelope = (SOAPEnvelope) builder.getDocumentElement();
        tempFile = File.createTempFile("temp", "xml");
        output =
                XMLOutputFactory.newInstance().createXMLStreamWriter(
                        new FileOutputStream(tempFile));
View Full Code Here

            throw new Exception("A SOAP file name must be provided !!");
        }
        XMLStreamReader parser = XMLInputFactory.newInstance()
                .createXMLStreamReader(new FileReader(getTestResourceFile(fileName)));

        return (SOAPEnvelope) new StAXSOAPModelBuilder(parser, null).getDocumentElement();
    }
View Full Code Here

                }else if(mimeMessage.getContentType().indexOf(SOAP11Constants.SOAP_11_CONTENT_TYPE) > -1){
                    soapNamespaceURI = SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI;

                }

                StAXBuilder builder = new StAXSOAPModelBuilder(reader, soapNamespaceURI);

                SOAPEnvelope envelope = (SOAPEnvelope) builder.getDocumentElement();
                msgContext.setEnvelope(envelope);
                if (envelope.getBody().hasFault()) {
                    engine.receiveFault(msgContext);
                } else {
                    engine.receive(msgContext);
View Full Code Here

    public SOAPEnvelope createSOAPEnvelope(InputStream in) throws AxisFault {
        try {
            XMLStreamReader xmlreader =
                    XMLInputFactory.newInstance().createXMLStreamReader(in);
            StAXBuilder builder = new StAXSOAPModelBuilder(xmlreader, null);
            return (SOAPEnvelope) builder.getDocumentElement();
        } catch (Exception e) {
            throw new AxisFault(e.getMessage(), e);
        }
    }
View Full Code Here

                msgContext.setProperty(MessageContext.TRANSPORT_OUT, out);

                //create the SOAP Envelope
                Reader in = new InputStreamReader(socket.getInputStream());
                XMLStreamReader xmlreader = XMLInputFactory.newInstance().createXMLStreamReader(in);
                StAXBuilder builder = new StAXSOAPModelBuilder(xmlreader, null);
                SOAPEnvelope envelope = (SOAPEnvelope) builder.getDocumentElement();
                msgContext.setEnvelope(envelope);
                if (envelope.getBody().hasFault()) {
                    engine.receiveFault(msgContext);
                } else {
                    engine.receive(msgContext);
View Full Code Here

                        .indexOf(SOAP12Constants.SOAP_12_CONTENT_TYPE)
                        > -1) {
                        soap11 = false;
                        //it is SOAP 1.2
                        builder =
                            new StAXSOAPModelBuilder(
                                xmlreader,
                                SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
                        envelope = (SOAPEnvelope) builder.getDocumentElement();
                    } else if (
                        contentType.indexOf(
                            SOAP11Constants.SOAP_11_CONTENT_TYPE)
                            > -1) {
                        soap11 = true;
                        //it is SOAP 1.1
                        Object enable =
                            msgContext.getProperty(
                                Constants.Configuration.ENABLE_REST);
                        if ((soapActionHeader == null
                            || soapActionHeader.length() == 0)
                            && Constants.VALUE_TRUE.equals(enable)) {
                            //If the content Type is text/xml (BTW which is the SOAP 1.1 Content type ) and
                            //the SOAP Action is absent it is rest !!
                            msgContext.setDoingREST(true);

                            SOAPFactory soapFactory = new SOAP11Factory();
                            builder = new StAXOMBuilder(xmlreader);
                            builder.setOmbuilderFactory(soapFactory);
                            envelope = soapFactory.getDefaultEnvelope();
                            envelope.getBody().addChild(
                                builder.getDocumentElement());
                        } else {
                            builder =
                                new StAXSOAPModelBuilder(
                                    xmlreader,
                                    SOAP11Constants
                                        .SOAP_ENVELOPE_NAMESPACE_URI);
                            envelope =
                                (SOAPEnvelope) builder.getDocumentElement();
View Full Code Here

TOP

Related Classes of org.apache.axis2.soap.impl.llom.builder.StAXSOAPModelBuilder

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.