1

Currently I am using the lists.asmx webservice to POST a soap envelope and return specific list items. I really want the whole contents of the list. I realize how large that might get, but if this works the way I think it will, I'll be able to narrow that down.

Current code:

    var soapEnv =
            "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'> \
                <soapenv:Body> \
                     <GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'> \
                        <listName>Produce</listName> \
                            <ViewFields> \
                               <FieldRef Name='Quantity' /> \
                               <FieldRef Name='Quantity2' /> \
                           </ViewFields> \
                    </GetListItems> \
                </soapenv:Body> \
            </soapenv:Envelope>";
        $.ajax({
            url: "https://mydomain.com/Sandbox/bitest/_vti_bin/lists.asmx",
            type: "POST",
            dataType: "xml",
            data: soapEnv,
            success: function(xData, status) { /*DO STUFF*/ }
            });

Now I'm a bit of a greenhorn and I've just learned about the ListData.svc RESTful stuff that SharePoint 2010 will do. Let's say that I want to load the XML response from the ListData.svc service directly into a string. How do I do that?

    https://mydomain.com/Sandbox/bitest/_vti_bin/ListData.svc/Produce

Seems like that will be the better way to go!

  • I would have rather used <subsite_URL>/_vti_bin/owssvr.dll?Cmd=Display&List={List_GUID}&XMLDATA=TRUE&noredirect=true – Gennady Vanin Геннадий Ванин Sep 4 '12 at 15:55
  • Let's say I want to load the returned XML into a string; how do I do that? Perhaps it's easier than I think. Can I just say testXMLstring = <subsite_URL>/_vti_bin/owssvr.dll?Cmd=Display&List={List_GUID}&XMLDATA=TRUE&nore‌direct=true? It didn't seem to work. – Shrout1 Sep 4 '12 at 16:59
  • You probably should ask this on javascript forum(s). Kind of crazy to do such things in Javascript in sharepoint environment having around Infopath, C#, ASPX, etc. – Gennady Vanin Геннадий Ванин Sep 6 '12 at 18:14
  • The goal is to read the data as XML and then parse it out into JSON data arrays for use in JQPlot charting libraries. I'm on a VERY restrictive SharePoint farm and I can only manipulate data from the client side. I'd ask this question on a JavaScript site but they would probably tell me to ask it on a SharePoint site. After all, it is using a SharePoint service. – Shrout1 Sep 6 '12 at 18:35
  • Don't tell abt sharepoint webservice, tell any of a public one, for example from service-repository.com Infopath is also on client side – Gennady Vanin Геннадий Ванин Sep 6 '12 at 19:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.