post /_vti_bin/lists.asmx 400 (bad request) using spservices

May 1, 2015 at 2:02 PM
Hi am using your spservies, it wast worked perfectly at yesterder night.
but now today its not working fine. am getting this error in console.
here is my code. and in xData.responseText am not getting any reponse, am getting empty string. the user has admin rights to the site.


function ApproveUpdateListItem(itemID,SaveData,selectedVal)
{
var splitval=SaveData.split(",");
var radiovalues=selectedVal.split(",");
$().SPServices({
operation: 'UpdateListItems',
async: false,
listName: "Student_OnBoarding", 
updates: '<Batch OnError="Continue">' + 
         '<Method ID="1" Cmd="Update">' +
  '<Field Name="ID">' + itemID + '</Field>' + //Specifying the item id is very important here  
'<Field Name="GENDER">'+radiovalues[0]+'</Field>' +
'<Field Name="MARTIAL_x0020_STATUS">'+radiovalues[1]+'</Field>' +
'<Field Name="CustomerTitle">'+splitval[0]+'</Field>' +
'<Field Name="SURNAME_x0028_MR_x002f_MRS_x002f">'+splitval[1]+'</Field>' +
'<Field Name="FIRST_x0020_NAMES">'+splitval[2]+'</Field>' +
'<Field Name="OTHER_x0020_NAMES">'+splitval[3]+'</Field>' +
'<Field Name="DATE_x0020_OF_x0020_BIRTH">'+splitval[4]+'</Field>' +
'<Field Name="NATIONALITY">'+splitval[5]+'</Field>' +
'<Field Name="NAME_x0020_OF_x0020_INSTITUTION">'+splitval[6]+'</Field>' +
'<Field Name="YEAR_x0020_ADMITTED">'+splitval[7]+'</Field>' +
'<Field Name="YEAR_x0020_OF_x0020_COMPLETION">'+splitval[8]+'</Field>' +
'<Field Name="STUDENT_x0020_ID_x0020_NUMBER">'+splitval[9]+'</Field>' +
'<Field Name="SSNIT_x0020_NUMBER">'+splitval[10]+'</Field>' +
'<Field Name="HALL_x0020_OF_x0020_RESIDENCE_x0">'+splitval[11]+'</Field>' +
'<Field Name="DEPARTMENT">'+splitval[12]+'</Field>' +
'<Field Name="FACULTY">'+splitval[13]+'</Field>' +
'<Field Name="PURPOSE_x0020_OF_x0020_ACCOUNT_x">'+splitval[14]+'</Field>' +
'<Field Name="RESIDENTIAL_x0020_ADDRESS">'+splitval[15]+'</Field>' +
'<Field Name="POSTAL_x0020_ADDRESS">'+splitval[16]+'</Field>' +
'<Field Name="PHONE_x002e_TYPE">'+splitval[17]+'</Field>' +
'<Field Name="TELEPHONE_x0020_NUMBER">'+splitval[18]+'</Field>' +
'<Field Name="FAX">'+splitval[19]+'</Field>' +
'<Field Name="EMAIL">'+splitval[20]+'</Field>' +
'<Field Name="HOW_x0020_DID_x0020_YOU_x0020_HE">'+splitval[21]+'</Field>' +
'<Field Name="CONTACT_x0020_PERSON_x0020_NAME">'+splitval[22]+'</Field>' +
'<Field Name="CONTACT_x0020_PERSON_x0020_ADDRE">'+splitval[23]+'</Field>' +
'<Field Name="CONTACT_x0020_PERSON_x0020_TELEP">'+splitval[24]+'</Field>' +
'<Field Name="INTRODUCER">'+splitval[25]+'</Field>' +
'<Field Name="NOK_x002e_PHONE_x002e_TY">'+splitval[26]+'</Field>' +
'<Field Name="SECTOR">'+splitval[27]+'</Field>' +
'<Field Name="INDUSTRY">'+splitval[28]+'</Field>' +
'<Field Name="NATIONALITY_x002d__x0020_T24">'+splitval[29]+'</Field>' +
'<Field Name="CUSTOMER_x002e_STATUS">'+splitval[30]+'</Field>' +
'<Field Name="RESIDENCE">'+splitval[31]+'</Field>' +
'<Field Name="CITY_x002e_OF_x002e_RES">'+splitval[32]+'</Field>' +
'<Field Name="TARGET">'+splitval[33]+'</Field>' +
'<Field Name="STAFF_x002e_ID">'+splitval[34]+'</Field>' +
'<Field Name="CUST_x002e_PROFILE">'+splitval[35]+'</Field>' +
'<Field Name="CAPITAL_x002e_CHARGE">'+splitval[36]+'</Field>' +
'<Field Name="LANGUAGE">'+splitval[37]+'</Field>' +
'<Field Name="SIGNATURE">'+splitval[38]+'</Field>' +
'<Field Name="ACCOUNT_x002e_OFFICER">'+splitval[39]+'</Field>' +
'<Field Name="INTRODUCER0">'+splitval[40]+'</Field>' +
'<Field Name="VISIBILITY_x002e_CAL">'+splitval[41]+'</Field>' +
'<Field Name="REVIEW_x002e_FREQUENCY">'+splitval[42]+'</Field>' +
'<Field Name="COMPANY_x002e_BOOK1">'+splitval[43]+'</Field>' +
'<Field Name="MNEMONIC">'+splitval[44]+'</Field>' +
'<Field Name="Customer_x0020_ID">'+splitval[45]+'</Field>' +
//'<Field Name="STATUS">'+"Pending Authorization"+'</Field>' +
'<Field Name="BANK_x002e_CODE0">'+splitval[47]+'</Field>' +
'<Field Name="PERSONAL_x0020_SAVINGS_x0020_FOR">'+splitval[48]+'</Field>' +
'<Field Name="EXPECTED_x0020_NUMBER_x0020_OF_x">'+splitval[49]+'</Field>' +
'<Field Name="EXPECTED_x0020_DEPOSIT_x0020_AMO">'+splitval[50]+'</Field>' +

'<Field Name="EXPECTED_x0020_NUMBER_x0020_OF_x0">'+splitval[51]+'</Field>' +
'<Field Name="EXPECTED_x0020_WITHDRAWALS_x0020">'+splitval[52]+'</Field>' +
'<Field Name="SOURCE_x0028_S_x0029__x0020_OF_x">'+splitval[53]+'</Field>' +
'</Method>' +
         '</Batch>',
completefunc: function(xData, Status)
{
            //alert("Sending the xml request to the server was: " + status);
            alert("Sharepoint processing of the message returned: " + xData.responseText);
            //alert("Updated Successfully");
            var error=xData.responseText;
            var finderror=error.search('<ErrorCode>0x80020005</ErrorCode>');
            if(finderror=="-1")
            {
            alert("Updated Successfully");
            var SPurl = window.location.protocol + "//" + window.location.host + _spPageContextInfo.siteServerRelativeUrl;
            window.location=SPurl +"/Lists/Student_OnBoarding/Inputter.aspx";
            }
            else
            {
            alert("There are Some Errors or Junck Charecters in Data,Please Check All Entire Data");
            }
}
});
}
Coordinator
May 1, 2015 at 2:25 PM
Well, something has changed since last night, then!

I'd suggest breaking this down to the most simple update you can do (maybe only the Title) and then building up from there. I can't test this code, of course, so I think it's just debugging time on your end.

M.
May 1, 2015 at 2:49 PM
thanks marc for immidiate responce.
am passing some junk chars,thats y its not getting responce