예제 #1
0
  private XMLizable receive(
      Transport transport, QName responseElement, Class responseType, InputStream in)
      throws IOException, ConnectionException {

    XMLizable result;

    try {

      XmlInputStream xin = new XmlInputStream();
      xin.setInput(in, "UTF-8");

      if (transport.isSuccessful()) {
        result = bind(xin, responseElement, responseType);
      } else {
        throw createException(xin);
      }
    } catch (PullParserException e) {
      throw new ConnectionException("Failed to create/parse xml input stream ", e);
    } finally {
      in.close();
    }

    return result;
  }