private void checkVersion()

in src/main/java/org/apache/cxf/cwiki/SiteExporter.java [340:362]


    private void checkVersion() throws ParserConfigurationException, IOException {
        Document doc = DOMUtils.createDocument();
        Element el = doc.createElementNS(SOAPNS, "ns1:getServerInfo");
        Element el2 = doc.createElement("in0");
        el.appendChild(el2);
        el2.setTextContent(loginToken);
        doc.appendChild(el);

        doc = getDispatch().invoke(doc);
        el = DOMUtils.getFirstElement(DOMUtils.getFirstElement(doc.getDocumentElement()));
        while (el != null) {
            if ("majorVersion".equals(el.getLocalName())) {
                String major = DOMUtils.getContent(el);
                if (Integer.parseInt(major) >= 5) {
                    apiVersion = 2;
                    ((java.io.Closeable)dispatch).close();
                    dispatch = null;
                }
            }
              
            el = DOMUtils.getNextElement(el);
        }
    }