本文整理了Java中org.apache.xmlrpc.client.XmlRpcClientException.<init>()
方法的一些代码示例,展示了XmlRpcClientException.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XmlRpcClientException.<init>()
方法的具体详情如下:
包路径:org.apache.xmlrpc.client.XmlRpcClientException
类名称:XmlRpcClientException
方法名:<init>
[英]Create an XmlRpcClientException with the given message and underlying cause exception.
[中]使用给定的消息和潜在原因异常创建XmlRpcClientException。
代码示例来源:origin: xmlrpc/xmlrpc-client
protected InputStream getInputStream() throws XmlRpcException {
try {
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);
}
}
代码示例来源:origin: xmlrpc/xmlrpc-client
throw new XmlRpcClientException("Failed to close connection: " + e.getMessage(), e);
代码示例来源:origin: org.apache.xmlrpc/xmlrpc-client
throw new XmlRpcClientException("Failed to close connection: " + e.getMessage(), e);
代码示例来源:origin: org.apache.xmlrpc/xmlrpc-client
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);
}
}
代码示例来源:origin: rosjava/rosjava_core
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);
}
}
代码示例来源:origin: org.sonatype.sisu/sisu-xmlrpc-client
@Override
protected InputStream getInputStream()
throws XmlRpcException
{
try
{
client = builder.setHeaders( headers ).build();
// Check the status of the return
Response response = client.post( new ByteArrayBodyGenerator( byteOs.toByteArray() ) ).get();
return response.getResponseBodyAsStream();
}
catch ( InterruptedException e )
{
throw new XmlRpcClientException( "Interruption during communication: " + e.getMessage(), e );
}
catch ( ExecutionException e )
{
throw new XmlRpcClientException( "Execution error during communication: " + e.getMessage(), e );
}
catch ( IOException e )
{
throw new XmlRpcClientException( "I/O error in server communication: " + e.getMessage(), e );
}
finally
{
byteOs.reset();
}
}
代码示例来源:origin: stackoverflow.com
throw new XmlRpcClientException("Failed to parse server's response: " + e.getMessage(), e);
} catch (IOException e) {
throw new XmlRpcClientException("Failed to read server's response: " + e.getMessage(), e);
代码示例来源:origin: xmlrpc/xmlrpc-client
protected Object readResponse(XmlRpcStreamRequestConfig pConfig, InputStream pStream) throws XmlRpcException {
InputSource isource = new InputSource(pStream);
XMLReader xr = newXMLReader();
XmlRpcResponseParser xp;
try {
xp = new XmlRpcResponseParser(pConfig, getClient().getTypeFactory());
xr.setContentHandler(xp);
xr.parse(isource);
} catch (SAXException e) {
throw new XmlRpcClientException("Failed to parse servers response: " + e.getMessage(), e);
} catch (IOException e) {
throw new XmlRpcClientException("Failed to read servers response: " + e.getMessage(), e);
}
if (xp.isSuccess()) {
return xp.getResult();
} else {
throw new XmlRpcException(xp.getErrorCode(), xp.getErrorMessage());
}
}
}
代码示例来源:origin: org.eclipse.mylyn.commons/xmlrpc
@Override
protected InputStream getInputStream() throws XmlRpcException {
int responseCode = method.getStatusCode();
if (responseCode != HttpURLConnection.HTTP_OK) {
XmlRpcHttpException e = new XmlRpcHttpException(responseCode);
if (responseCode == HttpStatus.SC_UNAUTHORIZED) {
e.setAuthScheme(method.getHostAuthState().getAuthScheme());
}
throw e;
}
try {
return method.getResponseBodyAsStream();
} catch (HttpException e) {
throw new XmlRpcClientException("Error in HTTP transport: " + e.getMessage(), e); //$NON-NLS-1$
} catch (IOException e) {
throw new XmlRpcClientException("I/O error in server communication: " + e.getMessage(), e); //$NON-NLS-1$
}
}
代码示例来源:origin: org.sonatype.sisu/sisu-xmlrpc-client
protected Object readResponse(XmlRpcStreamRequestConfig pConfig, InputStream pStream) throws XmlRpcException {
InputSource isource = new InputSource(pStream);
XMLReader xr = newXMLReader();
XmlRpcResponseParser xp;
try {
xp = new XmlRpcResponseParser(pConfig, getClient().getTypeFactory());
xr.setContentHandler(xp);
xr.parse(isource);
} catch (SAXException e) {
throw new XmlRpcClientException("Failed to parse server's response: " + e.getMessage(), e);
} catch (IOException e) {
throw new XmlRpcClientException("Failed to read server's response: " + e.getMessage(), e);
}
if (xp.isSuccess()) {
return xp.getResult();
}
Throwable t = xp.getErrorCause();
if (t == null) {
throw new XmlRpcException(xp.getErrorCode(), xp.getErrorMessage());
}
if (t instanceof XmlRpcException) {
throw (XmlRpcException) t;
}
if (t instanceof RuntimeException) {
throw (RuntimeException) t;
}
throw new XmlRpcException(xp.getErrorCode(), xp.getErrorMessage(), t);
}
}
代码示例来源:origin: org.apache.xmlrpc/xmlrpc-client
protected Object readResponse(XmlRpcStreamRequestConfig pConfig, InputStream pStream) throws XmlRpcException {
InputSource isource = new InputSource(pStream);
XMLReader xr = newXMLReader();
XmlRpcResponseParser xp;
try {
xp = new XmlRpcResponseParser(pConfig, getClient().getTypeFactory());
xr.setContentHandler(xp);
xr.parse(isource);
} catch (SAXException e) {
throw new XmlRpcClientException("Failed to parse server's response: " + e.getMessage(), e);
} catch (IOException e) {
throw new XmlRpcClientException("Failed to read server's response: " + e.getMessage(), e);
}
if (xp.isSuccess()) {
return xp.getResult();
}
Throwable t = xp.getErrorCause();
if (t == null) {
throw new XmlRpcException(xp.getErrorCode(), xp.getErrorMessage());
}
if (t instanceof XmlRpcException) {
throw (XmlRpcException) t;
}
if (t instanceof RuntimeException) {
throw (RuntimeException) t;
}
throw new XmlRpcException(xp.getErrorCode(), xp.getErrorMessage(), t);
}
}
代码示例来源:origin: org.ogema.drivers/homematic-xmlrpc-ll
protected Object readResponse(XmlRpcStreamRequestConfig pConfig, InputStream pStream) throws XmlRpcException {
InputSource isource = new InputSource(pStream);
isource.setEncoding(pConfig.getEncoding()); //jl
XMLReader xr = newXMLReader();
XmlRpcResponseParser xp;
try {
xp = new XmlRpcResponseParser(pConfig, getClient().getTypeFactory());
xr.setContentHandler(xp);
xr.parse(isource);
} catch (SAXException e) {
throw new XmlRpcClientException("Failed to parse server's response: " + e.getMessage(), e);
} catch (IOException e) {
throw new XmlRpcClientException("Failed to read server's response: " + e.getMessage(), e);
}
if (xp.isSuccess()) {
return xp.getResult();
}
Throwable t = xp.getErrorCause();
if (t == null) {
throw new XmlRpcException(xp.getErrorCode(), xp.getErrorMessage());
}
if (t instanceof XmlRpcException) {
throw (XmlRpcException) t;
}
if (t instanceof RuntimeException) {
throw (RuntimeException) t;
}
throw new XmlRpcException(xp.getErrorCode(), xp.getErrorMessage(), t);
}
}
代码示例来源:origin: rosjava/rosjava_core
protected Object readResponse(XmlRpcStreamRequestConfig pConfig, InputStream pStream) throws XmlRpcException {
InputSource isource = new InputSource(pStream);
XMLReader xr = newXMLReader();
XmlRpcResponseParser xp;
try {
xp = new XmlRpcResponseParser(pConfig, getClient().getTypeFactory());
xr.setContentHandler(xp);
xr.parse(isource);
} catch (SAXException e) {
throw new XmlRpcClientException("Failed to parse server's response: " + e.getMessage(), e);
} catch (IOException e) {
throw new XmlRpcClientException("Failed to read server's response: " + e.getMessage(), e);
}
if (xp.isSuccess()) {
return xp.getResult();
}
Throwable t = xp.getErrorCause();
if (t == null) {
throw new XmlRpcException(xp.getErrorCode(), xp.getErrorMessage());
}
if (t instanceof XmlRpcException) {
throw (XmlRpcException) t;
}
if (t instanceof RuntimeException) {
throw (RuntimeException) t;
}
throw new XmlRpcException(xp.getErrorCode(), xp.getErrorMessage(), t);
}
}
代码示例来源:origin: org.apache.xmlrpc/xmlrpc-client
protected void setCredentials(XmlRpcHttpClientConfig pConfig)
throws XmlRpcClientException {
String auth;
try {
auth = HttpUtil.encodeBasicAuthentication(pConfig.getBasicUserName(),
pConfig.getBasicPassword(),
pConfig.getBasicEncoding());
} catch (UnsupportedEncodingException e) {
throw new XmlRpcClientException("Unsupported encoding: " + pConfig.getBasicEncoding(), e);
}
if (auth != null) {
setRequestHeader("Authorization", "Basic " + auth);
}
}
代码示例来源:origin: rosjava/rosjava_core
protected void setCredentials(XmlRpcHttpClientConfig pConfig)
throws XmlRpcClientException {
String auth;
try {
auth = HttpUtil.encodeBasicAuthentication(pConfig.getBasicUserName(),
pConfig.getBasicPassword(),
pConfig.getBasicEncoding());
} catch (UnsupportedEncodingException e) {
throw new XmlRpcClientException("Unsupported encoding: " + pConfig.getBasicEncoding(), e);
}
if (auth != null) {
setRequestHeader("Authorization", "Basic " + auth);
}
}
代码示例来源:origin: org.sonatype.sisu/sisu-xmlrpc-client
protected void setCredentials(XmlRpcHttpClientConfig pConfig)
throws XmlRpcClientException {
String auth;
try {
auth = HttpUtil.encodeBasicAuthentication(pConfig.getBasicUserName(),
pConfig.getBasicPassword(),
pConfig.getBasicEncoding());
} catch (UnsupportedEncodingException e) {
throw new XmlRpcClientException("Unsupported encoding: " + pConfig.getBasicEncoding(), e);
}
if (auth != null) {
setRequestHeader("Authorization", "Basic " + auth);
}
}
代码示例来源:origin: xmlrpc/xmlrpc-client
protected void setCredentials(XmlRpcHttpClientConfig pConfig)
throws XmlRpcClientException {
String auth;
try {
auth = HttpUtil.encodeBasicAuthentication(pConfig.getBasicUserName(),
pConfig.getBasicPassword(),
pConfig.getBasicEncoding());
} catch (UnsupportedEncodingException e) {
throw new XmlRpcClientException("Unsupported encoding: " + pConfig.getBasicEncoding(), e);
}
if (auth != null) {
setRequestHeader("Authorization", "Basic " + auth);
}
}
代码示例来源:origin: org.sonatype.sisu/sisu-xmlrpc-client
@Override
protected void initHttpHeaders( XmlRpcRequest xmlRpcRequest )
throws XmlRpcClientException
{
if ( !XmlRpcClientConfigImpl.class.isAssignableFrom( xmlRpcRequest.getConfig().getClass() ) )
{
throw new XmlRpcClientException( "Invalid XmlRpcRequest", null );
}
XmlRpcClientConfigImpl config = XmlRpcClientConfigImpl.class.cast( xmlRpcRequest.getConfig() );
super.initHttpHeaders( xmlRpcRequest );
configureProxy( config );
configureTimeout( config );
if ( config.getSslContext() != null )
{
builder.setSSLContext( config.getSslContext() );
}
if (config.isGzipRequesting())
{
builder.setRequestCompressionLevel(6);
}
builder.setUrl( config.getServerURL().toString() ).setFollowRedirects( config.isFollowRedirect() );
}
代码示例来源:origin: rosjava/rosjava_core
throw t;
} catch (Throwable t) {
throw new XmlRpcClientException("Failed to invoke method " + pRequest.getMethodName()
+ ": " + t.getMessage(), t);
代码示例来源:origin: org.apache.xmlrpc/xmlrpc-client
throw t;
} catch (Throwable t) {
throw new XmlRpcClientException("Failed to invoke method " + pRequest.getMethodName()
+ ": " + t.getMessage(), t);
内容来源于网络,如有侵权,请联系作者删除!