UpdateListItems and Soap error?

Dec 3, 2010 at 12:30 PM

Hopefully I'm just overlooking a small something.  My code below returns the error as seen from the xDate.responseXML.text "soap:ServerException of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown. Object reference not set to an instance of an object."  There is no additional information in any of the WFEs Event nor SharePoint logs. 

$().SPServices({
		operation: "UpdateListItems",
		async: false,
		batchCmd: "Update",
		listname: "HomeLines Newsletter Repository",
		ID: $id,
		valuepairs: [["ProcessStatus", value]],
		completefunc: function(xData, Status) {
			alert("Status = " + Status);
			alert("xData = " + xData.responseXML.text);
		}
	});

Can anyone point out to me where I'm going wrong?

Coordinator
Dec 3, 2010 at 12:35 PM
Try alerting xData.responseXML.xml instead and see if that tells you more. I assume '$id' and 'value' are defined? M.
Dec 6, 2010 at 12:09 PM

Yes, both $id and value are correctly defined (I can alert those and see the values expected).

Changed the code to the following and get this error:

xData.xml = <?xml version="1.0"?>

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="soap:ServerException" _mce_href="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>Exception">http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown.</faultstring><detail><errorstring xmlns="Object" _mce_href="http://schemas.microsoft.com/sharepoint/soap/">Object">http://schemas.microsoft.com/sharepoint/soap/">Object reference not set to an instance of an object.</errorstring></detail></soap:Fault></soap:Body></soap:Envelope>

Unfortunately, I still do not understand what this is telling me.  Can you please advise?

CODE UPDATED

	$().SPServices({
		operation: "UpdateListItems",
		async: false,
		batchCmd: "Update",
		listname: "HomeLines Newsletter Repository",
		ID: $id,
		valuepairs: [["ProcessStatus", value]],
		completefunc: function(xData, Status) {
			alert("Status = " + Status);
			alert("xData = " + xData.responseXML.text);
			alert("xData.xml = " + xData.responseXML.xml);
		}
	});

Coordinator
Dec 6, 2010 at 1:50 PM

What that message is telling you is that at least one of the values you are passing to the Web Service is not valid. The error reporting from the Web Services is pretty inconsistent, and like in this case, not always terribly helpful.

I don't see anything in your code that would cause a problem (though I can't always spot everything!) so check all of your values again: the name of the list, the column name, $id, value, etc.

M.

Dec 6, 2010 at 2:17 PM

Hi,

You got me searching too!

Try 'listName' in stead of 'listname' in your code. This will do the trick I guess.

Anita

Coordinator
Dec 6, 2010 at 2:31 PM

Aha! Told you I can't spot everything. I'll bet that Anita's got the fix for you.

M.

Dec 6, 2010 at 5:48 PM

Thank you both! Anita's change and re-creating the single column I was trying to update appears to have fixed my issue.