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

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


     
      ByteArrayInputStream is = new ByteArrayInputStream(os.toByteArray());
      XMLStreamReader reader = XMLInputFactory.newInstance()
          .createXMLStreamReader(is);

      StAXSOAPModelBuilder builder = new StAXSOAPModelBuilder(reader,
          envelopeNS);
      builder.setCache(true);

      return builder.getSOAPEnvelope();

    } catch (Exception e) {
      throw new WSSecurityException(
          "Error in converting document to SOAPEnvelope", e);
    }
View Full Code Here


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

   

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

    protected void setUp() throws Exception {
        XMLStreamReader xmlStreamReader = XMLInputFactory.newInstance().
                createXMLStreamReader(
                        new FileReader(
                                getTestResourceFile(TestConstants.SOAP_SOAPMESSAGE1)));
        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

     * @param parser
     * @return Returns StAXSOAPModelBuilder.
     */
    public static StAXSOAPModelBuilder createStAXSOAPModelBuilder(
            SOAPFactory soapFactory, XMLStreamReader parser) {
        return new StAXSOAPModelBuilder(parser, soapFactory, null);
    }
View Full Code Here

                                "http://moretesting.axis2.org", "axis2"), firstElement);
    }

    public void testGetText() {
        try {
            StAXSOAPModelBuilder soapBuilder = getOMBuilder(
                    "soap/OMElementTest.xml");
            SOAPEnvelope soapEnvelope = (SOAPEnvelope) soapBuilder.getDocumentElement();
            OMElement wsaTo = soapEnvelope.getHeader().getFirstChildWithName(
                    new QName(WSA_URI, WSA_TO));

            String expectedString = "http://localhost:8081/axis/services/BankPort";
            assertEquals("getText is not returning the correct value",
View Full Code Here

    public void testCode() {
        try {
            String filename = "test-resources/soap/wrongEnvelopeNamespace.xml";
            XMLStreamReader xmlr = XMLInputFactory.newInstance()
                    .createXMLStreamReader(new FileInputStream(filename));
            StAXBuilder builder = new StAXSOAPModelBuilder(xmlr, null); //exception here
            fail("Builder must fail here due to wrong SOAP namespace");
        } catch (SOAPProcessingException e) {
            assertTrue(true);
        } catch (FileNotFoundException e) {
            fail("Only SOAPProcessingException can be thrown here");
View Full Code Here

    protected void setUp() throws Exception {
        File file = getTestResourceFile(TestConstants.SAMPLE1);
        XMLStreamReader parser = XMLInputFactory.newInstance()
                .createXMLStreamReader(new FileReader(file));
        OMXMLParserWrapper builder = new StAXSOAPModelBuilder(parser, null);
        envelope = (SOAPEnvelope) builder.getDocumentElement();
    }
View Full Code Here

    }


    public void testExtractAddressingInformationFromHeaders() {
        try {
            StAXSOAPModelBuilder omBuilder = testUtil.getOMBuilder(
                    testFileName);

            SOAPHeader header = ((SOAPEnvelope) omBuilder.getDocumentElement()).getHeader();
            Options options =
                    inHandler.extractCommonAddressingParameters(header,
                            new Options(),
                            header.getHeaderBlocksWithNSURI(
                                    AddressingConstants.Submission.WSA_NAMESPACE),
View Full Code Here

                fromAddress.trim());
    }

    public void testWSAFinalInformation() {
        try {
            StAXSOAPModelBuilder omBuilder = testUtil.getOMBuilder(
                    wsaFinalTestFile);
            inHandler.addressingNamespace = AddressingConstants.Final.WSA_NAMESPACE;
            SOAPHeader header = ((SOAPEnvelope) omBuilder.getDocumentElement()).getHeader();
            Options options =
                    inHandler.extractCommonAddressingParameters(header,
                            new Options(),
                            header.getHeaderBlocksWithNSURI(
                                    AddressingConstants.Final.WSA_NAMESPACE),
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.