public XmlRpcTransport getTransport() { return new XmlRpcCommonsTransport(this); }
/** Creates a new instance. * @param pFactory The factory, which created this transport. */ public XmlRpcCommonsTransport(XmlRpcCommonsTransportFactory pFactory) { super(pFactory.getClient(), userAgent); HttpClient httpClient = pFactory.getHttpClient(); if (httpClient == null) { httpClient = newHttpClient(); } client = httpClient; }
for (;;) { client.executeMethod(method); if (!isRedirectRequired()) { break; throw new XmlRpcException("Too many redirects."); resetClientForRedirect();
protected void initHttpHeaders(XmlRpcRequest pRequest) throws XmlRpcClientException { config = (XmlRpcHttpClientConfig) pRequest.getConfig(); method = newPostMethod(config); super.initHttpHeaders(pRequest); if (config.getConnectionTimeout() != 0) client.getHttpConnectionManager().getParams().setConnectionTimeout(config.getConnectionTimeout()); if (config.getReplyTimeout() != 0) client.getHttpConnectionManager().getParams().setSoTimeout(config.getReplyTimeout()); method.getParams().setVersion(HttpVersion.HTTP_1_1); }
protected InputStream getInputStream() throws XmlRpcException { try { checkStatus(method); return method.getResponseBodyAsStream(); } catch (HttpException e) { throw new XmlRpcClientException("Error in HTTP transport: " + e.getMessage(), e); } catch (IOException e) { throw new XmlRpcClientException("I/O error in server communication: " + e.getMessage(), e); } }
public void writeRequest(OutputStream pOut) throws IOException { try { /* Make sure, that the socket is not closed by replacing it with our * own BufferedOutputStream. */ OutputStream ostream; if (isUsingByteArrayOutput(config)) { // No need to buffer the output. ostream = new FilterOutputStream(pOut){ public void close() throws IOException { flush(); } }; } else { ostream = new BufferedOutputStream(pOut){ public void close() throws IOException { flush(); } }; } pWriter.write(ostream); } catch (XmlRpcException e) { throw new XmlRpcIOException(e); } catch (SAXException e) { throw new XmlRpcIOException(e); } } public long getContentLength() { return contentLength; }
for (;;) { client.executeMethod(method); if (!isRedirectRequired()) { break; throw new XmlRpcException("Too many redirects."); resetClientForRedirect();
protected void initHttpHeaders(XmlRpcRequest pRequest) throws XmlRpcClientException { config = (XmlRpcHttpClientConfig) pRequest.getConfig(); method = newPostMethod(config); super.initHttpHeaders(pRequest); if (config.getConnectionTimeout() != 0) client.getHttpConnectionManager().getParams().setConnectionTimeout(config.getConnectionTimeout()); if (config.getReplyTimeout() != 0) client.getHttpConnectionManager().getParams().setSoTimeout(config.getReplyTimeout()); method.getParams().setVersion(HttpVersion.HTTP_1_1); }
protected InputStream getInputStream() throws XmlRpcException { try { checkStatus(method); return method.getResponseBodyAsStream(); } catch (HttpException e) { throw new XmlRpcClientException("Error in HTTP transport: " + e.getMessage(), e); } catch (IOException e) { throw new XmlRpcClientException("I/O error in server communication: " + e.getMessage(), e); } }
public void writeRequest(OutputStream pOut) throws IOException { try { /* Make sure, that the socket is not closed by replacing it with our * own BufferedOutputStream. */ OutputStream ostream; if (isUsingByteArrayOutput(config)) { // No need to buffer the output. ostream = new FilterOutputStream(pOut){ public void close() throws IOException { flush(); } }; } else { ostream = new BufferedOutputStream(pOut){ public void close() throws IOException { flush(); } }; } pWriter.write(ostream); } catch (XmlRpcException e) { throw new XmlRpcIOException(e); } catch (SAXException e) { throw new XmlRpcIOException(e); } } public long getContentLength() { return contentLength; }
public XmlRpcTransport getTransport() { return new XmlRpcCommonsTransport(this); }
/** Creates a new instance. * @param pFactory The factory, which created this transport. */ public XmlRpcCommonsTransport(XmlRpcCommonsTransportFactory pFactory) { super(pFactory.getClient(), userAgent); HttpClient httpClient = pFactory.getHttpClient(); if (httpClient == null) { httpClient = newHttpClient(); } client = httpClient; }
public XmlRpcTransport getTransport() { return new XmlRpcCommonsTransport(getClient()); } }