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

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


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


    }


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

            SOAPHeader header = ((SOAPEnvelope) omBuilder.getDocumentElement()).getHeader();
            MessageInformationHeaders messageInformationHeaders =
                    inHandler.extractCommonAddressingParameters(header,
                            null,
                            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();
            MessageInformationHeaders messageInformationHeaders =
                    inHandler.extractCommonAddressingParameters(header,
                            null,
                            header.getHeaderBlocksWithNSURI(
                                    AddressingConstants.Final.WSA_NAMESPACE),
View Full Code Here

        msgCtxt.setTo(epr);
        msgCtxt.setReplyTo(replyTo);
        msgCtxt.setEnvelope(defaultEnvelope);
        outHandler.invoke(msgCtxt);

        StAXSOAPModelBuilder omBuilder = testUtil.getOMBuilder("eprTest.xml");
        XMLComparator xmlComparator = new XMLComparator();
        assertTrue(
                xmlComparator.compare(omBuilder.getDocumentElement(),
                        defaultEnvelope));
    }
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

        } catch (XMLStreamException e) {
            log.info(e.getMessage());
        } catch (FileNotFoundException e) {
            log.info(e.getMessage());
        }
        return new StAXSOAPModelBuilder(parser, null);
    }
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

        super(testName);
    }

    public void testSOAPMessageCreation(){
        try {
            StAXSOAPModelBuilder soapBuilder = getOMBuilder("");
            SOAPMessage soapMessage = soapBuilder.getSoapMessage();
            assertNotNull(soapMessage);
            assertNotNull(soapMessage.getSOAPEnvelope());
        } catch (Exception e) {
            fail("Exception thrown "+ e);
        }
View Full Code Here

        outputFormat.setCharSetEncoding(UTF_16);
    envelope.serialize(byteOutStr, outputFormat);
   
    ByteArrayInputStream byteInStr = new ByteArrayInputStream(byteOutStr.toByteArray());
   
    StAXSOAPModelBuilder builder = new StAXSOAPModelBuilder(XMLInputFactory.newInstance().createXMLStreamReader(byteInStr, UTF_16),null);

    SOAPEnvelope resultEnv = builder.getSOAPEnvelope();
   
    OMElement bodyChildResult = resultEnv.getBody().getFirstElement();
   
    assertNotNull("No child in body element", bodyChildResult);
   
View Full Code Here

     
      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

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.