2

I'm trying to use the GetItem method to use for copying documents, but I'm not having luck with the field or stream parameters. Below is an example of how I attempted to store each of them. When I check the status, it returns "success" by the way.

 mystream = $(xData.responseXML).find("Stream").text();
                      console.log("mystream= " +mystream); //mystream always returns blank in console

$(xData.responseXML).find("FieldInformation").each(function(){
                    myfields+=$(this).get(0).xml;
                    console.log("myfields= " +myfields);  //myfields also returns blank in console

xData.responseText returns something like this: enter image description here and eventually ends with the binary followed by

</Stream></GetItemResponse></soap:Body></soap:Envelope>

When I try to run console.log(xData.responseXML); or console.log(xData.responseXML.xml); I get this error from the console: enter image description here

  • What does xData.responseText or xData.responseXML look like? – kei Mar 4 '14 at 19:25
  • How exactly are you calling $().SPServices()? What parameters for it are you using? – kei Mar 4 '14 at 19:40
  • I use: operation: "GetItem", Url: myurl, async: false, completefunc: function (xData, Status) { -- and then the info above – user3299197 Mar 4 '14 at 19:45
  • async:false looks like the culprit to me. Try it without that parameter. – kei Mar 4 '14 at 19:46
  • Should I have set it to true? I removed it, and stream and fields still return the same empty values I set them to originally. Should I be using responseText instead of responseXML in finding the stream and fieldinformation? – user3299197 Mar 4 '14 at 19:58
1

For some reason, although most people are able to use

$(xData.responseXML).find("FieldInformation").each(function()

I was having issues with it, so I used "responseText" in place of "responseXML". A user in the comments section helped me solve the issue privately.

update: I found that this issue was simply a bug in jquery 1.9.1.. http://bugs.jquery.com/ticket/13388

| improve this answer | |

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.