keyongtech


  keyongtech > windows.* > windows.powershell

 #1  
08-04-08, 10:54 PM
AdityaKir
Hi All,

I am trying to use UpdateListItems function of the sharepoint web services.
Below is the code i have written. I can fetch the Lists from the sharepoint
from for some reason I cannot Update the Sharepoint list. Can anybody help.

[void] [Reflection.Assembly]::LoadWithPartialName("System.Web.Services")

$URL = "http://my/sites/<name>/_vti_bin/lists.asmx?wsdl"
$ws = ./LibraryWebService.ps1 $url -r
$ws.Credentials=[System.Net.CredentialCache]::DefaultCredentials
[XML]$query = "<Batch OnError='Continue'><Method ID='1' Cmd='Update'><Field
Name='SrNo'>2</Field><Field Name='Name1'>God</Field></Method></Batch>"
$ws.UpdateListItems("FriendsList", $query)

Thanks,

Aditya
 #2  
08-05-08, 08:06 PM
Neil Chambers
I don't know how to help you directly but I can tell you that I revert to
asp.net for troubleshooting web service stuff. I have tried and failed to
create an application configuration to enable diagnostics tracing within
powershell but I have one that works well in asp.net. The good news is that
it's reasonably trivial to translate powershell to asp.net.

I used this post to get my asp.net webservice caller working:
http://www.kerrywong.com/2006/12/01/...vice-in-aspnet

It doesn't sound like you need a certificate but the post includes the
necessary web.config additions needed to enable tracing. ::sigh:: I just
wish I could get in working under PoSH!
The trace will give you a full transaction log of the methods you are trying
to use.

I'm sorry if that doesn't help but it's all I have to offer.

Cheers,
n

"AdityaKir" <AdityaKir> wrote in message
news:9c8b
[..]
 #3  
08-05-08, 08:34 PM
Oisin (x0n) Grehan [MVP]
On Aug 4, 6:54 pm, AdityaKir <Aditya>
wrote:
> Hi All,
>
> I am trying to use UpdateListItems function of the sharepoint web services.
> Below is the code i have written. I can fetch the Lists from the sharepoint
> from for some reason I cannot Update the Sharepoint list. Can anybody help.
>
> [void] [Reflection.Assembly]::LoadWithPartialName("System.Web.Services")
>
> $URL = "http://my/sites/<name>/_vti_bin/lists.asmx?wsdl"
> $ws = ./LibraryWebService.ps1 $url -r
> $ws.Credentials=[System.Net.CredentialCache]::DefaultCredentials
> [XML]$query = "<Batch OnError='Continue'><Method ID='1' Cmd='Update'><Field
> Name='SrNo'>2</Field><Field Name='Name1'>God</Field></Method></Batch>"
> $ws.UpdateListItems("FriendsList", $query)
>
> Thanks,
>
> Aditya


Hi Aditya,

Try this for inspiration:

http://www.nivot.org/2008/02/29/Mani...erShell.as px

- Oisin

PowerShell MVP
http://www.nivot.org/
Similar Threads
Lists.UpdateListItems

Hi there, I'm trying to update custom attributes on documents in a document library. I have a view on the document library that return the documents that I'm interested in...

Error when calling web service - UpdateListItems

Hi, I try to use web service [..] from InfoPath as follow: Lists.Lists listService = new Lists.Lists(); listService.Credentials = new...

Lists Web Service UpdateListItems

I am trying to update a list item in an Events List using the built in Sharepoint Web Services. It looks like the default (and undeletable) fields Begin and End do not want...

Lists.asmx:UpdateListItems

Has anyone successfully used UpdateListItems to update a single field in a single list item? I'm providing an XML fragment like what follows: <Batch OnError=\"Continue\"...


All times are GMT. The time now is 02:27 AM. | Privacy Policy