Update a Sharepoint List (Document Library)Folders using Web Services with Javascript

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ismailc
    New Member
    • Sep 2006
    • 200

    Update a Sharepoint List (Document Library)Folders using Web Services with Javascript

    Good day, I need help.

    I would like to Update a Sharepoint List (Document Library) Folders using Web Services with Javascript.

    I have searched on Goggle but nothing that updates a document Library using UpdateListsItem method & with it being a clientside i need to pass NT Credentials to the List

    Please provide code as I have to get this going & have no clue.

    Please Assist
  • ismailc
    New Member
    • Sep 2006
    • 200

    #2
    I got some example but struggling


    I'm adding the javascript within my xslt file
    I now get the error Uexpected XML delecration becuase xslt file alrady has xslt decleration <?xml version="1.0"?>

    Code:
    SCRIPT TYPE='text/javascript'>
    function SaveListItem()
    {
    var soapRequest = '<?xml version="1.0" encoding="utf-8"?>' +
    '<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">' +
    '<soap12:Body>'+
    '<UpdateListItems xmlns="http://schemas.microsoft.com/sharepoint/soap/">'+
    '<listName>{FE9526F8-1B17-40E5-9A91-56DCE868CF81}</listName>'+
    '<updates>'+
    '<Batch OnError="Continue">'+
    '<Method ID="1" Cmd="New">'+
    '<Field Name="ID">New</Field>'+
    '<Field Name="Title">TestData</Field>'+
    '</Method>'+
    '</Batch>'+
    '</updates>'+
    '</UpdateListItems>'+
    '</soap12:Body>'+
    '</soap12:Envelope>';
    xmlHttp=new XMLHttpRequest();
    xmlHttp.open('post', 'http://srv08-za143/workspace/departments/masterfiles/Vendor%20Takeon/_vti_bin/Lists.asmx', true);
    xmlHttp.setRequestHeader('Content-Type','application/soap+xml; charset=utf-8');
    xmlHttp.send(soapRequest);
    } 
    </SCRIPT>

    Comment

    • acoder
      Recognized Expert MVP
      • Nov 2006
      • 16032

      #3
      Try putting the code in its own file and including it.

      Comment

      Working...