Ciao a tutti ,

dovrei creare un'applicazione Java che usando i web services esposti da Sharepoint legga tutti i file che sono dentro una cartella.
Purtroppo riesco a navigare solo la prima cartella e non riesco ad accedere al secondo livello.
Posto il codice sperando che qualcuno mi aiuti....Sono disperato


Main
codice:
package com.daniele;


import java.net.Authenticator;
import java.util.ArrayList;


import com.microsoft.sharepoint.webservices.ListsSoap;


public class Main {
    public static void main(String[] args) {
        try {
     
            //Opening the SOAP port of the Lists Web Service
            String username = "xxx\\xxx";
            String password = "xxxx";


            NtlmAuthenticator authenticator = new NtlmAuthenticator(username, password);
            Authenticator.setDefault(authenticator);
            ListsSoap port = Manager.sharePointListsAuth(username, password);
     
            /*
             * Lists Web service parameters
             * The list names below must be the *original* names of the list.
             * if a list or column was renamed from SharePoint afterwards,
             * these parameters don't change.
             */
            String listName = "Documents/pippo";
            String rowLimit = "150";
            ArrayList<String> listColumnNames = new ArrayList<String>();
           // listColumnNames.add("Name");
            //listColumnNames.add("otherColumnName");
     
            //Displays the lists items in the console
            Manager.displaySharePointList(port, listName, listColumnNames, rowLimit);
        } catch (Exception ex) {
            System.err.println(ex);
        }
    }
}

Manager.java

codice:
package com.daniele;


import java.io.StringWriter;
import java.net.URL;
import java.util.ArrayList;


import javax.xml.namespace.QName;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import javax.xml.ws.BindingProvider;


import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.NodeList;


import com.microsoft.sharepoint.webservices.GetListAndViewResponse.GetListAndViewResult;
import com.microsoft.sharepoint.webservices.GetListCollectionResponse.GetListCollectionResult;
import com.microsoft.sharepoint.webservices.GetListItems;
import com.microsoft.sharepoint.webservices.GetListItemsResponse;
import com.microsoft.sharepoint.webservices.GetListItemsResponse.GetListItemsResult;
import com.microsoft.sharepoint.webservices.GetListResponse.GetListResult;
import com.microsoft.sharepoint.webservices.Lists;
import com.microsoft.sharepoint.webservices.ListsSoap;
import com.sun.org.apache.xerces.internal.dom.ElementNSImpl;


public class Manager {


    /**
     * Creates a port connected to the SharePoint Web Service given.
     * Authentication is done here. It also prints the authentication details
     * in the console.
     * @param userName SharePoint username
     * @param password SharePoint password
     * @return port ListsSoap port, connected with SharePoint
     * @throws Exception in case of invalid parameters or connection error.
     */
    public static ListsSoap sharePointListsAuth(String userName, String password) throws Exception {
        ListsSoap port = null;
        if (userName != null && password != null) {
            try {
                Lists service = new Lists(new URL("file:///C:/Users/xxx/xxx/Pippo/Configuration/list.wsdl"),
                        new QName("http://schemas.microsoft.com/sharepoint/soap/", "Lists"));
                port = service.getListsSoap();
                System.out.println("Web Service Auth Username: " + userName);
                ((BindingProvider) port).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, userName);
                ((BindingProvider) port).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, password);
            } catch (Exception e) {
                throw new Exception("Error: " + e.toString());
            }
        } else {
            throw new Exception("Couldn't authenticate: Invalid connection details given.");
        }
        return port;
    }
    
    
    /**
     * Creates a string from an XML file with start and end indicators
     * @param docToString document to convert
     * @return string of the xml document
     */
    public static String xmlToString(Document docToString) {
        String returnString = "\n-------------- XML START --------------\n";
        try {
            //create string from xml tree
            //Output the XML
            //set up a transformer
            TransformerFactory transfac = TransformerFactory.newInstance();
            Transformer trans;
            trans = transfac.newTransformer();
            trans.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
            trans.setOutputProperty(OutputKeys.INDENT, "yes");
            StringWriter sw = new StringWriter();
            StreamResult streamResult = new StreamResult(sw);
            DOMSource source = new DOMSource(docToString);
            trans.transform(source, streamResult);
            String xmlString = sw.toString();
            //print the XML
            returnString = returnString + xmlString;
        } catch (TransformerException ex) {
            Logger.getLogger(Manager.class.getName()).log(Level.ALL, null, ex);
        }
        returnString = returnString + "-------------- XML END --------------";
        return returnString;
    }
    
    /**
     * Connects to a SharePoint Lists Web Service through the given open port,
     * and reads all the elements of the given list. Only the ID and the given
     * attributes (column names) are displayed, as well as a dump of the SOAP
     * response from the Web Service (for debugging purposes).
     * @param port an already authentificated SharePoint Online SOAP port
     * @param listName original name of the Sharepoint list that is going to be read
     * @param listColumnNames arraylist containing the various names of the Columns
     * of the SharePoint list that are going to be read. If the column name isn't
     * found, then an exception will be thrown
     * @param rowLimit limits the number of rows (list items) that are going to
     * be returned
     * @throws Exception
     */
    public static void displaySharePointList(ListsSoap port, String listName, ArrayList<String> listColumnNames, String rowLimit) throws Exception {
        if (port != null && listName != null && listColumnNames != null && rowLimit != null) {
            try {
     
                //Here are additional parameters that may be set
                String viewName = "";
                GetListItems.ViewFields viewFields = null;
                GetListItems.Query query = null;
                GetListItems.QueryOptions queryOptions = null;
                
                String webID = "";
     port.getList(listName);
     //Calling the List Web Service
                GetListItemsResult result = port.getListItems(listName, viewName, query, viewFields, rowLimit, queryOptions, webID);
                Object listResult = result.getContent().get(0);
                if ((listResult != null) && (listResult instanceof ElementNSImpl)) {
                    ElementNSImpl node = (ElementNSImpl) listResult;
     
                    //Dumps the retrieved info in the console
                    Document document = node.getOwnerDocument();
                    System.out.println("SharePoint Online Lists Web Service Response:" + Manager.xmlToString(document));
     
                    //selects a list of nodes which have z:row elements
                    NodeList list = node.getElementsByTagName("z:row");
                    System.out.println("=> " + list.getLength() + " results from SharePoint Online");
     
                    //Displaying every result received from SharePoint, with its ID
                    for (int i = 0; i < list.getLength(); i++) {
     
                        //Gets the attributes of the current row/element
                        NamedNodeMap attributes = list.item(i).getAttributes();
                        System.out.println("******** Item ID: " + attributes.getNamedItem("ows_ID").getNodeValue()+" ********");
     
                        //Displays all the attributes of the list item that correspond to the column names given
                        for (String columnName : listColumnNames) {
                            String internalColumnName = "ows_" + columnName;
                            if (attributes.getNamedItem(internalColumnName) != null) {
                                System.out.println(columnName + ": " + attributes.getNamedItem(internalColumnName).getNodeValue());
                            } else {
                                throw new Exception("Couldn't find the '" + columnName + "' column in the '" + listName + "' list in SharePoint.\n");
                            }
                        }
                    }
                } else {
                    throw new Exception(listName + " list response from SharePoint is either null or corrupt\n");
                }
            } catch (Exception ex) {
                throw new Exception("Exception. See stacktrace." + ex.toString() + "\n");
            }
        }
    }
    
    
    
}