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

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


    }


    public void testExtractAddressingInformationFromHeaders() {
        try {
            StAXSOAPModelBuilder omBuilder = testUtil.getOMBuilder(testFileName);
           
            SOAPHeader header = ((SOAPEnvelope) omBuilder.getDocumentElement()).getHeader();
            MessageInformationHeadersCollection messageInformationHeadersCollection =
                    inHandler.extractCommonAddressingParameters(header, null,header.getHeaderBolcksWithNSURI(AddressingConstants.Submission.WSA_NAMESPACE), AddressingConstants.Submission.WSA_NAMESPACE);

            if(messageInformationHeadersCollection == null){
                fail("Addressing Information Headers have not been retrieved properly");
View Full Code Here


    public StAXSOAPModelBuilder getOMBuilder(String fileName) throws Exception {
        if (fileName == "" || fileName == null) {
            fileName = IN_FILE_NAME;
        }
        XMLStreamReader parser = XMLInputFactory.newInstance().createXMLStreamReader(new FileReader(getTestResourceFile(fileName)));
        builder = new StAXSOAPModelBuilder(parser);
        return builder;
    }
View Full Code Here

        MessageContext msgCtxt = new MessageContext(null);
        msgCtxt.setTo(epr);
        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

            XMLStreamReader reader =
                XMLInputFactory.newInstance().createXMLStreamReader(
                    new BufferedReader(new InputStreamReader(in)));

            StAXBuilder builder = new StAXSOAPModelBuilder(reader);
            msgCtx.setEnvelope((SOAPEnvelope) builder.getDocumentElement());
            AxisEngine engine = new AxisEngine(confContext);
            engine.receive(msgCtx);
        } catch (XMLStreamException e) {
            throw new AxisFault(e);
        } catch (FactoryConfigurationError e) {
View Full Code Here

    protected StAXSOAPModelBuilder getOMBuilder(String fileName) throws Exception {
        if (fileName == "" || fileName == null) {
            fileName = IN_FILE_NAME;
        }
        XMLStreamReader parser = XMLInputFactory.newInstance().createXMLStreamReader(new FileReader(getTestResourceFile(fileName)));
        builder = new StAXSOAPModelBuilder(parser);
        return builder;
    }
View Full Code Here

        return builder;
    }

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

    }

    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", wsaTo.getText().trim(), expectedString);
        } catch (Exception e) {
View Full Code Here

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

    public IteratorTester(String testName) {
        super(testName);
    }

    protected void setUp() throws Exception {
        envelope = new StAXSOAPModelBuilder(XMLInputFactory.newInstance().createXMLStreamReader(new FileReader(getTestResourceFile("soap/soapmessage1.xml")))).getSOAPEnvelope();
    }
View Full Code Here

 
  public SOAPPartImpl(SOAPMessageImpl parent, Object initialContents, boolean isBodyStream) throws SOAPException{
   
        setMimeHeader(HTTPConstants.HEADER_CONTENT_ID , SessionUtils.generateSessionId());
        setMimeHeader(HTTPConstants.HEADER_CONTENT_TYPE , "text/xml");
        StAXSOAPModelBuilder stAXSOAPModelBuilder;
       
        msgObject = parent;
        try{
          if(initialContents instanceof SOAPEnvelope){
            ((SOAPEnvelopeImpl)initialContents).setOwnerDocument(this);
            envelope = initialContents;
          } else if(initialContents instanceof InputStream){
            //XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader((InputStream)initialContents);
            InputStreamReader inr = new InputStreamReader((InputStream)initialContents);
            stAXSOAPModelBuilder = new StAXSOAPModelBuilder(XMLInputFactory.newInstance().createXMLStreamReader(inr));
            org.apache.axis2.soap.SOAPEnvelope omEnv = stAXSOAPModelBuilder.getSOAPEnvelope();
            envelope = new SOAPEnvelopeImpl(omEnv);
            ((SOAPEnvelopeImpl)envelope).setOwnerDocument(this);
          }
       
        }catch(Exception 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.