Examples of OMOutput


Examples of org.apache.axis2.om.OMOutput

            //EndpointReference targetEPR = new EndpointReference(AddressingConstants.WSA_TO, "http://127.0.0.1:" + Utils.TESTING_PORT + "/axis/services/EchoXMLService");
           
            call.setTransportInfo(Constants.TRANSPORT_HTTP,Constants.TRANSPORT_HTTP,false);
            call.setTo(targetEPR);
            OMElement result = call.invokeBlocking(operationName.getLocalPart(),method);
            OMOutput omOutput = new OMOutput(XMLOutputFactory.newInstance().createXMLStreamWriter(System.out));
            result.serialize(omOutput);
           omOutput.flush();
            fail("the test must fail due to bad service Name");
        } catch (AxisFault e) {
            e.printStackTrace();
            assertTrue((e.getMessage().indexOf(UtilServer.FAILURE_MESSAGE)) > 0);
            return;
View Full Code Here

Examples of org.apache.axis2.om.OMOutput

    if (envelope != null && msgContext.isDoingREST()) {
      outputMessage = envelope.getBody().getFirstElement();
    }

    if (outputMessage != null) {
      OMOutput omOutput = null;

      try {
        if (msgContext.isDoingMTOM()) {
          omOutput = new OMOutput(out, true);
          outputMessage.serialize(omOutput);
          omOutput.flush();
                    omOutput.complete();
          out.flush();
        } else {
          omOutput = new OMOutput(out, false);
          outputMessage.serialize(omOutput);
          omOutput.flush();
          out.flush();
        }
      } catch (Exception e) {
        throw new AxisFault("Stream error", e);
      }
View Full Code Here

Examples of org.apache.axis2.om.OMOutput

        assertFalse("SOAP 1.2 Fault Test with parser: - getDetail method returns null", soap12FaultWithParser.getDetail() == null);
        assertTrue("SOAP 1.2 Fault Test with parser: - Fault detail local name mismatch", soap12FaultWithParser.getDetail().getLocalName().equals(SOAP12Constants.SOAP_FAULT_DETAIL_LOCAL_NAME));
    }

    public void testMoreChildrenAddition() {
        OMOutput output = null;
        try {
            output = new OMOutput(System.out, false);
            SOAPFactory soapFactory = OMAbstractFactory.getSOAP12Factory();
            SOAPEnvelope envelope = soapFactory.getDefaultFaultEnvelope();

            assertNotNull("Default FaultEnvelope must have a SOAPFault in it", envelope.getBody().getFault());
            assertNotNull("Default FaultEnvelope must have a SOAPFaultCode in it", envelope.getBody().getFault().getCode());
View Full Code Here

Examples of org.apache.axis2.om.OMOutput

 
  public void testImageSampleSerialize() throws Exception {
   
    outMTOMFile = getTestResourceFile(outFileName);
    outBase64File = getTestResourceFile(outBase64FileName);
    OMOutput mtomOutput = new OMOutput(new FileOutputStream(outMTOMFile),true);
    OMOutput baseOutput = new OMOutput(new FileOutputStream(outBase64File),false);
   
    OMNamespaceImpl soap = new OMNamespaceImpl(
        "http://schemas.xmlsoap.org/soap/envelope/", "soap");
    OMElement envelope = new OMElementImpl("Envelope", soap);
    OMElement body = new OMElementImpl("Body", soap);
   
    OMNamespaceImpl dataName = new OMNamespaceImpl(
        "http://www.example.org/stuff", "m");
    OMElement data = new OMElementImpl("data", dataName);
   
    expectedImage = new JDK13IO().loadImage(new FileInputStream(
        getTestResourceFile(imageInFileName)));
    ImageDataSource dataSource = new ImageDataSource("WaterLilies.jpg",
        expectedImage);
    expectedDH = new DataHandler(dataSource);
    OMText binaryNode = new OMTextImpl(expectedDH, true);
   
    envelope.addChild(body);
    body.addChild(data);
    data.addChild(binaryNode);
   
    envelope.serialize(baseOutput);
    baseOutput.flush();
   
    envelope.serialize(mtomOutput);
    mtomOutput.flush();
    mtomOutput.complete();
  }
View Full Code Here

Examples of org.apache.axis2.om.OMOutput

    }
  }

  public void testComplete() throws Exception {

    OMOutput mtomOutput = new OMOutput(new FileOutputStream(
        outMTOMFile), true);
    OMOutput baseOutput = new OMOutput(new FileOutputStream(
        outBase64File), false);

    envelope.serialize(baseOutput);
    baseOutput.flush();

    envelope.serialize(mtomOutput);

    mtomOutput.complete();
  }
View Full Code Here

Examples of org.apache.axis2.om.OMOutput

    protected void setUp() throws Exception {
        readerOne = XMLInputFactory.newInstance().
                createXMLStreamReader(new InputStreamReader(new ByteArrayInputStream(xmlTextOne.getBytes())));
        readerTwo = XMLInputFactory.newInstance().
                createXMLStreamReader(new InputStreamReader(new ByteArrayInputStream(xmlTextTwo.getBytes())));
        omOutput = new OMOutput(XMLOutputFactory.newInstance().
                createXMLStreamWriter(System.out));
        builderOne = OMXMLBuilderFactory.createStAXSOAPModelBuilder(OMAbstractFactory.getSOAP11Factory(), readerOne);
        builderTwo = OMXMLBuilderFactory.createStAXSOAPModelBuilder(OMAbstractFactory.getSOAP11Factory(), readerTwo);
    }
View Full Code Here

Examples of org.apache.axis2.om.OMOutput

        SOAPEnvelope env = omFactory.getDefaultEnvelope();
        OMXMLParserWrapper builder = OMXMLBuilderFactory.createStAXOMBuilder(omFactory,XMLInputFactory.newInstance().
                createXMLStreamReader(new InputStreamReader(new ByteArrayInputStream(xmlText2.getBytes()))));
        env.getBody().addChild(builder.getDocumentElement());

        OMOutput omOutput =  new OMOutput(System.out,false);
        //env.getBody().addChild(builder.getDocumentElement());
       
        env.serializeWithCache(omOutput);
       // env.serializeWithCache(xmlStreamWriter, true);

        omOutput.flush();

    }
View Full Code Here

Examples of org.apache.axis2.om.OMOutput

    }

    public void testStaxBuilder() throws Exception {
        SOAPEnvelope envelope = (SOAPEnvelope) builder.getDocumentElement();
        assertNotNull(envelope);
        OMOutput omOutput = new OMOutput(new FileOutputStream(tempFile),false);
        //        XMLStreamWriter writer = XMLOutputFactory.newInstance().createXMLStreamWriter(System.out);
        envelope.serializeWithCache(omOutput);


    }
View Full Code Here

Examples of org.apache.axis2.om.OMOutput

    protected void setUp() throws Exception {
        reader = XMLInputFactory.newInstance().
                createXMLStreamReader(new FileReader(getTestResourceFile("soap/soapmessage.xml")));
        tempFile = File.createTempFile("temp", "xml");
        omOutput = new OMOutput(XMLOutputFactory.newInstance().
                createXMLStreamWriter(new FileOutputStream(tempFile)));
        //        writer = XMLOutputFactory.newInstance().
        //                createXMLStreamWriter(System.out);
    }
View Full Code Here

Examples of org.apache.axis2.om.OMOutput

    }

    protected void setUp() throws Exception {
        super.setUp();
        soapEnvelope = (SOAPEnvelope) getOMBuilder("soap/soap11/soap11fault.xml").getDocumentElement();
        omOutput = new OMOutput(XMLOutputFactory.newInstance().
                createXMLStreamWriter(System.out));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.