aspose file tools*
The moose likes Web Services and the fly likes Sharepoint web services Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Sharepoint web services" Watch "Sharepoint web services" New topic
Author

Sharepoint web services

Mohammad Akon
Greenhorn

Joined: Jul 17, 2007
Posts: 19
Hi All,

Not sure if this is the right place for this kind of post!!

I am using Lists.asmx web service within my Java Client to retrieve data ((list of files with their attribute such as Name, author, Date Modified, etc.)) from the sharepoint server. The attributes associated with each list item are displayed as a column header in the sharepoint server. For example:



Sharepoint allows the user to change the column headers, e.g. I can change column header "MyColumn" to "YourColumn".

To do this I am sending the following soap request:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetListItems xmlns="http://schemas.microsoft.com/sharepoint/soap/" >
<listName>Test Area</listName>
<viewName></viewName><query>
<Query xmlns:ns2="http://schemas.microsoft.com/sharepoint/soap/" xmlns="">
<OrderBy><FieldRef Name="FileLeafRef" /></OrderBy>
</Query>
</query>
<viewFields><ViewFields>
<FieldRef Name="ID" /><FieldRef Name="Title" /><FieldRef Name="Editor" /><FieldRef Name="Author" /><FieldRef Name="Modified" /><FieldRef Name="Created" /><FieldRef Name="UniqueId"/>
</ViewFields></viewFields>
<rowLimit>120</rowLimit>
<queryOptions>
<QueryOptions xmlns:ns2="http://schemas.microsoft.com/sharepoint/soap/" xmlns=""><IncludeMandatoryColumns>FALSE</IncludeMandatoryColumns><ViewAttributes Scope="Recursive" />
<Folder>Test Area/</Folder>
</QueryOptions></queryOptions>
<webID></webID>
</GetListItems>
</soap:Body>
</soap:Envelope>Folder>Test Area/</Folder>
</QueryOptions></queryOptions><webID></webID>
</GetListItems></soap:Body>
</soap:Envelope>


And the response I am getting is something like:

<listitems xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema" xmlns="http://schemas.microsoft.com/sharepoint/soap/">
<rs:data ItemCount="2">
…..
<z:row ows_GUID="{3C5844E1-4F98-4EE5-A789-1DCCA3E1BF3A}" ows_ContentType="DB Base Content Type" ows_BaseName="key facts 8 April" ows_Modified="2009-03-13 17:31:30" ows_EncodedAbsUrl="https://localhost/site/a.txt" ows__ModerationStatus="0" ows__Level="1" ows_ID="1" ows_owshiddenversion="3" ows_UniqueId="1;#{B7ED8578-227D-4202-B18A-369BFE5F28A0}" ows_FSObjType="1;#0" ows_Created_x0020_Date="1;#2008-12-12 16:18:48" ows_ProgId="1;#" ows_FileLeafRef="1;#a.txt" ows_FileRef="1;#site/Test Area/a.txt" ows_DocIcon="txt" ows_Editor="25657;#mohammad" ows_MetaInfo="1;#vti_parserversion:SR|12.0.0.6219 vti_modifiedby:SR|localhost\\mohammad ContentTypeId:SW|0x010100C777E5E4CC2845A982076CBB472177EA00D40C3F427C6AD44FA3313036C6D99659 vti_title:SW| ContentType:SW|DB Base Content Type test:SW|test vti_author:SR|localhost\\mohammad MyColumn:SW|comment1" ows_Last_x0020_Modified="1;#2009-03-13 17:31:31" />
............
</rs:data>
</listitems>


Now, even if I change "MyColumn" to "YourColumn", with the same soap request I am getting the same response, where as it should give "YourColumn".

Is there anything I can do to get the changed column header?

Any help is appreciated.

Thanks in advance.

-Mohammad
Matt Zollinhofer
Ranch Hand

Joined: Jul 09, 2004
Posts: 33
My response is a bit late, but in case you're still tracking this I'll throw out a comment. And I'm not exactly sure what you're asking for, but it sounds to me like you want to know how to send a message to a Sharepoint list to change one of the list's column names.

If that is correct, one of the things I noticed is that you're calling GetListItems. I don't think that's the method of the web service that you want to call. I think you want to call UpdateListItems. Check out this page for more details: UpdateListItems at MSDN. Search for "column" on the page and you'll see an example of how to update that. I haven't updated column names myself, but I have inserted new items using that method so I'd think that should work too.

Keep us posted.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Sharepoint web services