Package org.apache.ws.commons.serialize

Examples of org.apache.ws.commons.serialize.XMLWriter


    return new OpenXgXmlWriter();
  }

  public ContentHandler getXmlWriter(XmlRpcStreamConfig pConfig, OutputStream pStream)
      throws XmlRpcException {
    XMLWriter xw = newXmlWriter();
    xw.setDeclarating(true);
    String enc = pConfig.getEncoding();
    if (enc == null) {
      enc = XmlRpcStreamConfig.UTF8_ENCODING;
    }
    xw.setEncoding(enc);
    xw.setIndenting(false);
    xw.setFlushing(true);
   
    log.debug(":: getXmlWriter ::");
   
    try {
      xw.setWriter(new BufferedWriter(new OutputStreamWriter(pStream, enc)));
    } catch (UnsupportedEncodingException e) {
      throw new XmlRpcException(0, "Unsupported encoding: " + enc + e);
    }
    return xw;
  }
View Full Code Here


    }

    static String writeRequest(XmlRpcClient pClient, XmlRpcRequest pRequest)
            throws SAXException {
        StringWriter sw = new StringWriter();
        XMLWriter xw = new XMLWriterImpl();
        xw.setEncoding("US-ASCII");
        xw.setDeclarating(true);
        xw.setIndenting(false);
        xw.setWriter(sw);
        XmlRpcWriter xrw = new XmlRpcWriter((XmlRpcStreamConfig) pClient.getConfig(), xw, pClient.getTypeFactory());
        xrw.write(pRequest);
        return sw.toString();
    }
View Full Code Here

    return new XMLWriterImpl();
  }

  public ContentHandler getXmlWriter(XmlRpcStreamConfig pConfig, OutputStream pStream)
      throws XmlRpcException {
    XMLWriter xw = newXmlWriter();
    xw.setDeclarating(true);
    String enc = pConfig.getEncoding();
    if (enc == null) {
      enc = XmlRpcStreamConfig.UTF8_ENCODING;
    }
    xw.setEncoding(enc);
    xw.setIndenting(false);
    xw.setFlushing(true);
    try {
      xw.setWriter(new BufferedWriter(new OutputStreamWriter(pStream, enc)));
    } catch (UnsupportedEncodingException e) {
      throw new XmlRpcException("Unsupported encoding: " + enc, e);
    }
    return xw;
  }
View Full Code Here

    }

    static String writeRequest(XmlRpcClient pClient, XmlRpcRequest pRequest)
            throws SAXException {
        StringWriter sw = new StringWriter();
        XMLWriter xw = new XMLWriterImpl();
        xw.setEncoding("US-ASCII");
        xw.setDeclarating(true);
        xw.setIndenting(false);
        xw.setWriter(sw);
        XmlRpcWriter xrw = new XmlRpcWriter((XmlRpcStreamConfig) pClient.getConfig(), xw, pClient.getTypeFactory());
        xrw.write(pRequest);
        return sw.toString();
    }
View Full Code Here

    }

    static String writeRequest(XmlRpcClient pClient, XmlRpcRequest pRequest)
            throws SAXException {
        StringWriter sw = new StringWriter();
        XMLWriter xw = new XMLWriterImpl();
        xw.setEncoding("US-ASCII");
        xw.setDeclarating(true);
        xw.setIndenting(false);
        xw.setWriter(sw);
        XmlRpcWriter xrw = new XmlRpcWriter((XmlRpcStreamConfig) pClient.getConfig(), xw, pClient.getTypeFactory());
        xrw.write(pRequest);
        return sw.toString();
    }
View Full Code Here

    return new XMLWriterImpl();
  }

  public ContentHandler getXmlWriter(XmlRpcStreamConfig pConfig, OutputStream pStream)
      throws XmlRpcException {
    XMLWriter xw = newXmlWriter();
    xw.setDeclarating(true);
    String enc = pConfig.getEncoding();
    if (enc == null) {
      enc = XmlRpcStreamConfig.UTF8_ENCODING;
    }
    xw.setEncoding(enc);
    xw.setIndenting(false);
    xw.setFlushing(true);
    try {
      xw.setWriter(new BufferedWriter(new OutputStreamWriter(pStream, enc)));
    } catch (UnsupportedEncodingException e) {
      throw new XmlRpcException("Unsupported encoding: " + enc, e);
    }
    return xw;
  }
View Full Code Here

    private XmlRpcStreamRequestConfig xmlRpcStreamRequestConfig = new XmlRpcHttpRequestConfigImpl();
    private TypeFactory typeFactory = new TypeFactoryImpl(null);
    private boolean isRequest;
   
    protected XMLWriter getXMLWriter(Exchange exchange, OutputStream outputStream) throws XmlRpcException {
        XMLWriter writer = new CharSetXMLWriter();
        String encoding = IOHelper.getCharsetName(exchange);
        writer.setEncoding(encoding);
        writer.setIndenting(false);
        writer.setFlushing(true);
        try {
            writer.setWriter(new BufferedWriter(new OutputStreamWriter(outputStream, encoding)));
        } catch (UnsupportedEncodingException e) {
            throw new XmlRpcException("Unsupported encoding: " + encoding, e);
        }
        return writer;
    }
View Full Code Here

    }

    @Override
    public void marshal(Exchange exchange, Object graph, OutputStream stream) throws Exception {
        // need to check the object type
        XMLWriter control = getXMLWriter(exchange, stream);
        XmlRpcWriter writer = new XmlRpcWriter(xmlRpcStreamRequestConfig, control, typeFactory);
        if (graph instanceof XmlRpcRequest) {
            writer.writeRequest(xmlRpcStreamRequestConfig, (XmlRpcRequest)graph);
        } else {
            // write the result here directly
View Full Code Here

  }

  protected String writeRequest(XmlRpcStreamRequestConfig pConfig, XmlRpcRequest pRequest)
      throws SAXException {
    StringWriter sw = new StringWriter();
    XMLWriter xw = new XMLWriterImpl();
    xw.setEncoding("US-ASCII");
    xw.setDeclarating(true);
    xw.setIndenting(false);
    xw.setWriter(sw);
    XmlRpcWriter xrw = new XmlRpcWriter(pConfig, xw, client.getTypeFactory());
    xrw.write(pRequest);
    return sw.toString();
  }
View Full Code Here

  }

  protected String writeRequest(XmlRpcStreamRequestConfig pConfig, XmlRpcRequest pRequest)
      throws XmlRpcException, SAXException {
    StringWriter sw = new StringWriter();
    XMLWriter xw = new XMLWriterImpl();
    xw.setEncoding("US-ASCII");
    xw.setDeclarating(true);
    xw.setIndenting(false);
    xw.setWriter(sw);
    XmlRpcWriter xrw = new XmlRpcWriter(pConfig, xw, client.getTypeFactory());
    xrw.write(pRequest);
    return sw.toString();
  }
View Full Code Here

TOP

Related Classes of org.apache.ws.commons.serialize.XMLWriter

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.