I am trying to consume a SharePoint Web Service GetListItems.
The below is the XML request from SoapUI:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://schemas.microsoft.com/sharepoint/soap/">
<soapenv:Header/>
<soapenv:Body>
<soap:GetListItems>
<soap:listName>OnLineFormsList</soap:listName>
<soap:Query>
<Where>
<Eq>
<FieldRef Name="Item Type" />
<Value Type="String">Personal</Value>
</Eq>
</Where>
</soap:Query>
<viewFields>
<FieldRef Name="Process ID" />
<FieldRef Name="Title" />
<FieldRef Name="Description" />
</viewFields>
<soap:rowLimit>50</soap:rowLimit>
<queryOptions xmlns:SOAPSDK9=
"http://schemas.microsoft.com/sharepoint/soap/" >
<QueryOptions/>
</queryOptions>
<soap:webID></soap:webID>
</soap:GetListItems>
</soapenv:Body>
</soapenv:Envelope>
I am getting a 403 FORBIDDEN
error each time I try to consume an SP Web Service.
The thing is from within JS code (which is integrated into a Content Editor Web Part in a particular page) I can consume the Web Service, but from SoapUI I can't.
JS Code:
var soapPacket = "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'>" +
" <soapenv:Body> " +
" <GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'> " +
" <listName>OnlineFormsList</listName> " +
" <query><Query> " +
" <Where><And><Eq><FieldRef Name='Enabled'/><Value Type='Text'>Yes</Value></Eq> " +
" <Eq><FieldRef Name='Index'/><Value Type='Text'>" + index + "</Value></Eq></And></Where> " +
" </Query></query> " +
" <rowLimit><RowLimit>5000</RowLimit></rowLimit>" +
" <viewFields> " +
" <ViewFields> " +
" <FieldRef Name='Title' /> " +
" <FieldRef Name='Description' /> " +
" <FieldRef Name='Item_x0020_Type' /> " +
" <FieldRef Name='Form_x0020_Link' /> " +
" <FieldRef Name='Document_x0020_Link' /> " +
" <FieldRef Name='Form_x0020_Publishing_x0020_Type' /> " +
" <FieldRef Name='Index' /> " +
" <FieldRef Name='Process_x0020_ID' /> " +
" <FieldRef Name='Ministry' /> " +
" <FieldRef Name='Competent_x0020_Authority' /> " +
" <FieldRef Name='Business_x0020_Taxonomy' /> " +
" <FieldRef Name='Subject_x0020_Taxonomy' /> " +
" <FieldRef Name='Life_x0020_Events_x0020_Taxonomy' /> " +
" </ViewFields> " +
" </viewFields> " +
" </GetListItems> " +
" </soapenv:Body> " +
" </soapenv:Envelope> ";
jQuery.ajax({
url: "/en/Services-And-Information/eforms/_vti_bin/lists.asmx",
type: "POST",
async: true,
dataType: "xml",
data: soapPacket,
complete: processResult,
contentType: "text/xml; charset=\"utf-8\""
});
I am using SharePoint 2013 Enterprise.