我正在使用CURL从sharepoint列表中提取数据。现在,我面临的问题是从sharepoint返回的数据是双重编码的(例如'>'不会变成'& gt;'而是'& amp; gt;')。我该如何解决这个问题? 示例电话:
POST /sites/00133/_vti_bin/Lists.asmx HTTP/1.1
User-Agent: curl/7.26.0
Host: team.sp.wp.intra.net
Accept: */*
Content-Type: text/xml; charset=utf8
SOAPAction: http://schemas.microsoft.com/sharepoint/soap/GetListItems
<?xml version='1.0' encoding='utf-8'?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:SOAP-ENC='http://schemas.xmlsoap.org/soap/encoding/' xmlns:ns4630='http://tempuri.org'>
<SOAP-ENV:Body>
<GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'>
<listName>{D44FAB23-172F-4756-B573-3E903D21F468}</listName>
<viewName>{79D163F7-3750-49DD-9782-AE9F15B35268}</viewName>
<queryOptions><QueryOptions><IncludeMandatoryColumns>FALSE</IncludeMandatoryColumns></QueryOptions></queryOptions>
<query><Query><Where><Eq><FieldRef Name="Title" /><Value Type="Text">0023120112</Value></Eq></Where></Query></query>
</GetListItems>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
示例共鸣:
HTTP/1.1 200 OK
Cache-Control: private, max-age=0
Content-Type: text/xml; charset=utf-8
Server: Microsoft-IIS/7.5
SPRequestGuid: 7ec7d0cc-2be3-4884-a54f-bb6883eb3584
X-SharePointHealthScore: 0
X-AspNet-Version: 2.0.50727
Persistent-Auth: true
X-Powered-By: ASP.NET
MicrosoftSharePointTeamServices: 14.0.0.7102
X-MS-InvokeApp: 1; RequireReadOnly
Date: Thu, 30 Jan 2014 12:22:17 GMT
Content-Length: 1967
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="h
ttp://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:BDC6E3F0-6DA3-11d1-A2 A3-00AA00C14882' xmlns:dt='uuid:C2F41010-65B3-11d1-A29F-00AA00C14882' xmlns:rs='urn:schemas-microsoft-com:rowset' xmlns:z='#RowsetSchema'>
<rs:data ItemCount="1">
<z:row ows_LinkTitle='0023120112' ows_Issue_x0020_Name='Test' ows_Description='VPC --&gt; please consider Attachment ' ows__ModerationStatus='0' ows__Level='1' ows_UniqueId='947;#{0FAF4F6D-7952-4771-86C2-81DC3CDB2EAF}' ows_FSObjType='947;#0' ows_Created_x0020_Date='947;#2014-01-07 07:27:04' ows_Modified='2014-01-30 13:10:19' ows_MetaInfo='947;#' ows_ID='947' ows_owshiddenversion='612' ows_Created='2014-01-07 07:27:04' ows_Title='0023120112' ows_FileLeafRef='947;#947_.000' ows_PermMask='0x7fffffffffffffff' ows_FileRef='947;#sites/00133/Lists/Post Go Live Issue Tracking/947_.000' />
</rs:data>
</listitems>
</GetListItemsResult>
</GetListItemsResponse>
</soap:Body>
</soap:Envelope>