/** Writes a servers error message to the output stream. * @param pConfig The request configuration. * @param pCode The error code * @param pMessage The error message * @throws SAXException Writing the error message failed. */ public void write(XmlRpcRequestConfig pConfig, int pCode, String pMessage) throws SAXException { write(pConfig, pCode, pMessage, null); }
/** Writes the requests uncompressed XML data to the given * output stream. Ensures, that the output stream is being * closed. */ public void write(OutputStream pStream) throws XmlRpcException, IOException, SAXException { final XmlRpcStreamConfig config = (XmlRpcStreamConfig) request.getConfig(); try { ContentHandler h = getClient().getXmlWriterFactory().getXmlWriter(config, pStream); XmlRpcWriter xw = new XmlRpcWriter(config, h, getClient().getTypeFactory()); xw.write(request); pStream.close(); pStream = null; } finally { if (pStream != null) { try { pStream.close(); } catch (Throwable ignore) {} } } } }
protected XmlRpcWriter getXmlRpcWriter(XmlRpcStreamRequestConfig pConfig, OutputStream pStream) throws XmlRpcException { ContentHandler w = getXMLWriterFactory().getXmlWriter(pConfig, pStream); return new XmlRpcWriter(pConfig, w, getTypeFactory()); }
/** Writes a servers response to the output stream. * @param pConfig The request configuration. * @param pResult The result object. * @throws SAXException Writing the response failed. */ public void write(XmlRpcRequestConfig pConfig, Object pResult) throws SAXException { handler.startDocument(); boolean extensions = pConfig.isEnabledForExtensions(); if (extensions) { handler.startPrefixMapping("ex", XmlRpcWriter.EXTENSIONS_URI); } handler.startElement("", "methodResponse", "methodResponse", ZERO_ATTRIBUTES); handler.startElement("", "params", "params", ZERO_ATTRIBUTES); handler.startElement("", "param", "param", ZERO_ATTRIBUTES); writeValue(pResult); handler.endElement("", "param", "param"); handler.endElement("", "params", "params"); handler.endElement("", "methodResponse", "methodResponse"); if (extensions) { handler.endPrefixMapping("ex"); } handler.endDocument(); }
/** Writes the requests uncompressed XML data to the given * output stream. Ensures, that the output stream is being * closed. */ public void write(OutputStream pStream) throws XmlRpcException, IOException, SAXException { final XmlRpcStreamConfig config = (XmlRpcStreamConfig) request.getConfig(); try { ContentHandler h = getClient().getXmlWriterFactory().getXmlWriter(config, pStream); XmlRpcWriter xw = new XmlRpcWriter(config, h, getClient().getTypeFactory()); xw.write(request); pStream.close(); pStream = null; } finally { if (pStream != null) { try { pStream.close(); } catch (Throwable ignore) {} } } } }
protected XmlRpcWriter getXmlRpcWriter(XmlRpcStreamRequestConfig pConfig, OutputStream pStream) throws XmlRpcException { ContentHandler w = getXMLWriterFactory().getXmlWriter(pConfig, pStream); return new XmlRpcWriter(pConfig, w, getTypeFactory()); }
/** Writes a servers response to the output stream. * @param pConfig The request configuration. * @param pResult The result object. * @throws SAXException Writing the response failed. */ public void write(XmlRpcRequestConfig pConfig, Object pResult) throws SAXException { handler.startDocument(); boolean extensions = pConfig.isEnabledForExtensions(); if (extensions) { handler.startPrefixMapping("ex", XmlRpcWriter.EXTENSIONS_URI); } handler.startElement("", "methodResponse", "methodResponse", ZERO_ATTRIBUTES); handler.startElement("", "params", "params", ZERO_ATTRIBUTES); handler.startElement("", "param", "param", ZERO_ATTRIBUTES); writeValue(pResult); handler.endElement("", "param", "param"); handler.endElement("", "params", "params"); handler.endElement("", "methodResponse", "methodResponse"); if (extensions) { handler.endPrefixMapping("ex"); } handler.endDocument(); }
/** Writes the requests uncompressed XML data to the given * output stream. Ensures, that the output stream is being * closed. */ public void write(OutputStream pStream) throws XmlRpcException, IOException, SAXException { final XmlRpcStreamConfig config = (XmlRpcStreamConfig) request.getConfig(); try { ContentHandler h = getClient().getXmlWriterFactory().getXmlWriter(config, pStream); XmlRpcWriter xw = new XmlRpcWriter(config, h, getClient().getTypeFactory()); xw.write(request); pStream.close(); pStream = null; } finally { if (pStream != null) { try { pStream.close(); } catch (Throwable ignore) {} } } } }
/** Writes a servers error message to the output stream. * @param pConfig The request configuration. * @param pCode The error code * @param pMessage The error message * @throws SAXException Writing the error message failed. */ public void write(XmlRpcRequestConfig pConfig, int pCode, String pMessage) throws SAXException { write(pConfig, pCode, pMessage, null); }
protected XmlRpcWriter getXmlRpcWriter(XmlRpcStreamRequestConfig pConfig, OutputStream pStream) throws XmlRpcException { ContentHandler w = getXMLWriterFactory().getXmlWriter(pConfig, pStream); return new XmlRpcWriter(pConfig, w, getTypeFactory()); }
/** Writes a servers response to the output stream. * @param pConfig The request configuration. * @param pResult The result object. * @throws SAXException Writing the response failed. */ public void write(XmlRpcRequestConfig pConfig, Object pResult) throws SAXException { handler.startDocument(); boolean extensions = pConfig.isEnabledForExtensions(); if (extensions) { handler.startPrefixMapping("ex", XmlRpcWriter.EXTENSIONS_URI); } handler.startElement("", "methodResponse", "methodResponse", ZERO_ATTRIBUTES); handler.startElement("", "params", "params", ZERO_ATTRIBUTES); handler.startElement("", "param", "param", ZERO_ATTRIBUTES); writeValue(pResult); handler.endElement("", "param", "param"); handler.endElement("", "params", "params"); handler.endElement("", "methodResponse", "methodResponse"); if (extensions) { handler.endPrefixMapping("ex"); } handler.endDocument(); }
/** Writes the requests uncompressed XML data to the given * output stream. Ensures, that the output stream is being * closed. */ public void write(OutputStream pStream) throws XmlRpcException, IOException, SAXException { final XmlRpcStreamConfig config = (XmlRpcStreamConfig) request.getConfig(); try { ContentHandler h = getClient().getXmlWriterFactory().getXmlWriter(config, pStream); XmlRpcWriter xw = new XmlRpcWriter(config, h, getClient().getTypeFactory()); xw.write(request); pStream.close(); pStream = null; } finally { if (pStream != null) { try { pStream.close(); } catch (Throwable ignore) {} } } } }
/** Writes a servers error message to the output stream. * @param pConfig The request configuration. * @param pCode The error code * @param pMessage The error message * @throws SAXException Writing the error message failed. */ public void write(XmlRpcRequestConfig pConfig, int pCode, String pMessage) throws SAXException { write(pConfig, pCode, pMessage, null); }
writeValue(map); handler.endElement("", "fault", "fault"); handler.endElement("", "methodResponse", "methodResponse");
/** Writes the requests uncompressed XML data to the given * output stream. Ensures, that the output stream is being * closed. */ public void write(OutputStream pStream) throws XmlRpcException, IOException, SAXException { final XmlRpcStreamConfig config = (XmlRpcStreamConfig) request.getConfig(); try { ContentHandler h = getClient().getXmlWriterFactory().getXmlWriter(config, pStream); XmlRpcWriter xw = new XmlRpcWriter(config, h, getClient().getTypeFactory()); xw.write(request); pStream.close(); pStream = null; } finally { if (pStream != null) { try { pStream.close(); } catch (Throwable ignore) {} } } } }
protected void writeResponse(XmlRpcStreamRequestConfig pConfig, OutputStream pStream, Object pResult) throws XmlRpcException { try { getXmlRpcWriter(pConfig, pStream).write(pConfig, pResult); } catch (SAXException e) { throw new XmlRpcException("Failed to write XML-RPC response: " + e.getMessage(), e); } }
writeValue(map); handler.endElement("", "fault", "fault"); handler.endElement("", "methodResponse", "methodResponse");
protected void writeResponse(XmlRpcStreamRequestConfig pConfig, OutputStream pStream, Object pResult) throws XmlRpcException { try { getXmlRpcWriter(pConfig, pStream).write(pConfig, pResult); } catch (SAXException e) { throw new XmlRpcException("Failed to write XML-RPC response: " + e.getMessage(), e); } }
writeValue(map); handler.endElement("", "fault", "fault"); handler.endElement("", "methodResponse", "methodResponse");
protected void writeResponse(XmlRpcStreamRequestConfig pConfig, OutputStream pStream, Object pResult) throws XmlRpcException { try { getXmlRpcWriter(pConfig, pStream).write(pConfig, pResult); } catch (SAXException e) { throw new XmlRpcException("Failed to write XML-RPC response: " + e.getMessage(), e); } }