org.apache.xmlrpc.parser.XmlRpcResponseParser.getErrorMessage()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(5.0k)|赞(0)|评价(0)|浏览(139)

本文整理了Java中org.apache.xmlrpc.parser.XmlRpcResponseParser.getErrorMessage()方法的一些代码示例,展示了XmlRpcResponseParser.getErrorMessage()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XmlRpcResponseParser.getErrorMessage()方法的具体详情如下:
包路径:org.apache.xmlrpc.parser.XmlRpcResponseParser
类名称:XmlRpcResponseParser
方法名:getErrorMessage

XmlRpcResponseParser.getErrorMessage介绍

[英]If the response contained a fault, returns the error message.
[中]如果响应包含错误,则返回错误消息。

代码示例

代码示例来源:origin: stackoverflow.com

throw new XmlRpcException(xp.getErrorCode(), xp.getErrorMessage());
  throw (RuntimeException) t;
throw new XmlRpcException(xp.getErrorCode(), xp.getErrorMessage(), t);

代码示例来源: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.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.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.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);
  }
}

相关文章