Examples of OMOutputFormat


Examples of org.apache.axiom.om.OMOutputFormat

        removeUnwantedHeaders(msgContext);

        ServerWorker worker = (ServerWorker) msgContext.getProperty(Constants.OUT_TRANSPORT_INFO);
        HttpResponse response = worker.getResponse();

        OMOutputFormat format = NhttpUtil.getOMOutputFormat(msgContext);
        MessageFormatter messageFormatter =
                MessageFormatterDecoratorFactory.createMessageFormatterDecorator(msgContext);
        Boolean noEntityBody = (Boolean) msgContext.getProperty(NhttpConstants.NO_ENTITY_BODY);
        if (noEntityBody == null || Boolean.FALSE == noEntityBody) {
            response.setHeader(
View Full Code Here

Examples of org.apache.axiom.om.OMOutputFormat

        return httpStatus;
    }

    private void sendUsingOutputStream(MessageContext msgContext) throws AxisFault {

        OMOutputFormat format = NhttpUtil.getOMOutputFormat(msgContext);
        MessageFormatter messageFormatter =
                MessageFormatterDecoratorFactory.createMessageFormatterDecorator(msgContext);
        OutputStream out = (OutputStream) msgContext.getProperty(MessageContext.TRANSPORT_OUT);

        if (msgContext.isServerSide()) {
View Full Code Here

Examples of org.apache.axiom.om.OMOutputFormat

    public void testGetBytes() {

        try {
            HessianMessageFormatter formatter = new HessianMessageFormatter();
            OMOutputFormat format = new OMOutputFormat();
            HessianTestHelper testHelper = new HessianTestHelper();
            MessageContext msgContext = testHelper.createAxis2MessageContext(null);
            formatter.getBytes(msgContext, format);
            fail("getBytes() should have thrown an AxisFault!");
        } catch (AxisFault fault) {
View Full Code Here

Examples of org.apache.axiom.om.OMOutputFormat

        }
    }

    public void testGetContentType() throws AxisFault {
        HessianMessageFormatter formatter = new HessianMessageFormatter();
        OMOutputFormat format = new OMOutputFormat();
        String soapActionString = "soapAction";
        HessianTestHelper testHelper = new HessianTestHelper();
        MessageContext msgContext = testHelper.createAxis2MessageContext(null);
        String contentType = formatter.getContentType(msgContext, format, soapActionString);
        assertEquals(HessianConstants.HESSIAN_CONTENT_TYPE, contentType);

        msgContext.setProperty(Constants.Configuration.CONTENT_TYPE,
            HessianConstants.HESSIAN_CONTENT_TYPE);
        format.setCharSetEncoding(HessianTestHelper.CHARSET_ENCODING);
        contentType = formatter.getContentType(msgContext, format, soapActionString);
        String expectedContentType = HessianConstants.HESSIAN_CONTENT_TYPE + "; charset="
            + HessianTestHelper.CHARSET_ENCODING;
        assertEquals(expectedContentType, contentType);
    }
View Full Code Here

Examples of org.apache.axiom.om.OMOutputFormat

    writeTo(new OutputStreamWriter(out));
  }

  public void writeTo(java.io.Writer writer) throws IOException {
    try {
      OMOutputFormat outputFormat = new OMOutputFormat();
      if (getDocument() != null && getDocument().getCharset() != null)
        outputFormat.setCharSetEncoding(getDocument().getCharset());
      serialize(writer, outputFormat);
    } catch (XMLStreamException e) {
      throw new FOMException(e);
    }
  }
View Full Code Here

Examples of org.apache.axiom.om.OMOutputFormat

        removeUnwantedHeaders(msgContext);
       
        ServerWorker worker = (ServerWorker) msgContext.getProperty(Constants.OUT_TRANSPORT_INFO);
        HttpResponse response = worker.getResponse();

        OMOutputFormat format = NhttpUtil.getOMOutputFormat(msgContext);
        MessageFormatter messageFormatter =
                MessageFormatterDecoratorFactory.createMessageFormatterDecorator(msgContext);
        Boolean noEntityBody = (Boolean) msgContext.getProperty(NhttpConstants.NO_ENTITY_BODY);
        if (noEntityBody == null || Boolean.FALSE == noEntityBody) {
            response.setHeader(
View Full Code Here

Examples of org.apache.axiom.om.OMOutputFormat

        return httpStatus;
    }

    private void sendUsingOutputStream(MessageContext msgContext) throws AxisFault {

        OMOutputFormat format = NhttpUtil.getOMOutputFormat(msgContext);
        MessageFormatter messageFormatter =
                MessageFormatterDecoratorFactory.createMessageFormatterDecorator(msgContext);
        OutputStream out = (OutputStream) msgContext.getProperty(MessageContext.TRANSPORT_OUT);

        if (msgContext.isServerSide()) {
View Full Code Here

Examples of org.apache.axiom.om.OMOutputFormat

    private void populateResponseFile(FileObject responseFile, MessageContext msgContext,
                                      boolean append, boolean lockingEnabled) throws AxisFault {
       
        MessageFormatter messageFormatter = BaseUtils.getMessageFormatter(msgContext);
        OMOutputFormat format = BaseUtils.getOMOutputFormat(msgContext);
       
        try {
            CountingOutputStream os = new CountingOutputStream(
                    responseFile.getContent().getOutputStream(append));
            try {
View Full Code Here

Examples of org.apache.axiom.om.OMOutputFormat

    System.out.println("New Text = " + text);
    omElement.setText(text);
   
    // Serialize
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    OMOutputFormat omFormat = new OMOutputFormat();
    omFormat.setXmlStreamWriterFilter(new XMLStreamWriterRemoveIllegalChars());
    env1.serialize(baos, omFormat);
   
    String xmlText = baos.toString();
    System.out.println("Serialized Text = " + xmlText);
   
View Full Code Here

Examples of org.apache.axiom.om.OMOutputFormat

        envelope.getBody().addChild(bodyChild);


        ByteArrayOutputStream byteOutStr = new ByteArrayOutputStream();

        OMOutputFormat outputFormat = new OMOutputFormat();
        outputFormat.setCharSetEncoding(UTF_16);
        envelope.serialize(byteOutStr, outputFormat);

        ByteArrayInputStream byteInStr = new ByteArrayInputStream(byteOutStr.toByteArray());

        SOAPModelBuilder builder = OMXMLBuilderFactory.createSOAPModelBuilder(
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.