SharePointにJavaScriptでTickerを実装する - WebService の呼び出し(3)
返値
正常時
GetListItems は /soap:Envelope/soap:Body/GetListItemsResponse/GetListItemsResult/Library 以下に1アイテム 1row としてデータが返ってくる。それぞれのフィールドの値は row の属性値とその値だが、viewFields で指定したフィールド名の頭に ows_ がなぜだかついてくる。
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<GetListItemsResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/">
<GetListItemsResult>
<listitems xmlns:s='uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' xmlns:dt='uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' xmlns:rs='urn:schemas-microsoft-com:rowset' xmlns:z='#RowsetSchema'>
<rs:data ItemCount="11">
<z:row ows_Attachments='0' ows_LinkTitle='〜〜〜〜' ows_Modified='2008-08-21 10:33:23' ows_MetaInfo='5;#' ows__ModerationStatus='0' ows__Level='1' ows_Title='〜〜〜〜' ows_ID='5' ows_owshiddenversion='6' ows_UniqueId='5;#{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}' ows_FSObjType='5;#0' ows_Created_x0020_Date='5;#2007-05-21 16:11:45' ows_Created='2007-05-21 16:11:45' ows_FileLeafRef='5;#5_.000' ows_FileRef='5;#Lists/List4/5_.000' />
(略)
</rs:data>
</listitems>
</GetListItemsResult>
</GetListItemsResponse>
</soap:Body>
</soap:Envelope>
エラー時
SOAP のエラーとして返ってくるので、/soap:Envelope/soap:Body/soap:Fault があればエラーと見てよさそう。下記は viewName を指定したけど、そのビューがなかった場合のエラー例
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>種類 'Microsoft.SharePoint.SoapServer.SoapServerException' の例外がスローされました。</faultstring>
<detail>
<errorstring xmlns="http://schemas.microsoft.com/sharepoint/soap/">
ビューがありません。
選択したページは、存在しないビューを参照しています。他のユーザーによって削除された可能性があります。
</errorstring>
<errorcode xmlns="http://schemas.microsoft.com/sharepoint/soap/">0x82000005</errorcode>
</detail>
</soap:Fault>
</soap:Body>
</soap:Envelope>