Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Using the UpdateListItem Method from Windows Script

24 views
Skip to first unread message

Ryan

unread,
Jun 27, 2005, 4:36:19 PM6/27/05
to
I think I have a syntax error on my hands, but I really have no idea --
and I can't seem to crack this. I'm trying to update a list in
SharePoint using the UpdateListItem method in the Lists web service.
I'm using VBScript. Here's the script:

Set connector = CreateObject("MSOSOAP.HttpConnector30")
connector.Property("EndPointURL") =
"https://server/_vti_bin/lists.asmx"
connector.Property("SoapAction")
="http://schemas.microsoft.com/sharepoint/soap/UpdateListItems"
connector.Connect

Set serializer = CreateObject("MSOSoap.SoapSerializer30")
with serializer
.Init(connector.InputStream)
.startEnvelope()
.startBody()
.StartElement "UpdateListItems",
"http://schemas.microsoft.com/sharepoint/soap/"
.StartElement "ListName",
"http://schemas.microsoft.com/sharepoint/soap/"
.WriteString("WebTest")
.EndElement()
.StartElement "updates",
"http://schemas.microsoft.com/sharepoint/soap/"
.WriteXML("<batch OnError='Continue' ListVersion='1' ViewName=><Method
ID='1' Cmd='Update'><Field
Name='Title'><!CDATA['Test']]></Field></Method></batch>")
.EndElement()
.EndElement()
.endBody()
.endEnvelope()
End With

connector.EndMessage()
Set reader = CreateObject("MSOSOAP.SoapReader30")
reader.Load(connector.OutputStream)
Wscript.echo reader.Body.xml

-----------------------------------------
Here's the error message I'm getting:
<faultcode>soap:Client</faultcode>
<faultstring>Server was unable to read request. --&gt; There is an
error in XML document (1, 470). --&gt; This is an unexpected token.
The expected token is 'QUOTE'. Line 1, position 520.</faultstring>

-----------------------------------------
I think the problem is in the XML batch, but I've tried every
combination I can think of. The problem could be the ViewName -- I
left it null, b/c apparently that uses the default view. If I put
something there, it has to be the GUID, and I'm not sure where to find
it...

Any help would be greatly appreciated!

Ryan

unread,
Jun 27, 2005, 4:37:31 PM6/27/05
to

Mike Walsh

unread,
Jun 28, 2005, 1:19:30 AM6/28/05
to
Please post questions on web services (and other WSS Programming matters) to
the subnewsgroup at

microsoft.public.sharepoint.windowsservices.development

which was set up specially for WSS programming questions and which has the
assembled experts on these matters as its readers.

Please post future WSS Programming questions only there so we can maintain
the clear split in content between the two newsgroups for the benefit of
all.

Thanks.

Mike Walsh, Helsinki, Finland
WSS FAQ at http://wss.collutions.com
Please reply to the newsgroup

"Ryan" <Ryan.La...@gmail.com> wrote in message
news:1119904650.9...@g44g2000cwa.googlegroups.com...

Mike Walsh

unread,
Jun 28, 2005, 1:23:59 AM6/28/05
to
This was also (I now see) posted to the .development newsgroup as a separate
posting.

Please do not post the same message to both newsgroups.As we have already
seen in this thread it wastes people's time who reply to one newsgroup not
knowing of the same message in the other.

As you know about the other newsgroup please separate your messages and post
WSS Programming questions there and non-WSS Programming questions here.

Mike Walsh, Helsinki, Finland
WSS FAQ at http://wss.collutions.com
Please reply to the newsgroup

"Ryan" <Ryan.La...@gmail.com> wrote in message
news:1119904650.9...@g44g2000cwa.googlegroups.com...

ismal

unread,
Jan 4, 2010, 4:34:45 AM1/4/10
to
Good day, Really new to this.

I'm struggling to do the same, did you manage to get this going.

Please help.

url:http://www.ureader.com/msg/12321552.aspx

0 new messages