Пример #1
0
  private void readSoapHeader(XmlInputStream xin) throws IOException, ConnectionException {
    while (!headerEndTag(xin)) {
      xin.peekTag();

      if (xin.getEventType() == XmlInputStream.START_TAG) {
        QName tag = new QName(xin.getNamespace(), xin.getName());

        Class headerType = (knownHeaders != null) ? knownHeaders.get(tag) : null;

        if (headerType != null) {
          TypeInfo info = new TypeInfo(xin.getNamespace(), xin.getName(), null, null, 1, 1, true);
          XMLizable result = (XMLizable) typeMapper.readObject(xin, info, headerType);
          if (connection != null) {
            setHeader(tag, headerType, result);
          }
        } else {
          throw new ConnectionException("Unrecognized header: " + tag.toString());
        }
      }
    }
    xin.next();
  }