Theoretically yes. My experience has been creating web services outside of SharePoint 2010 and reading data into SharePoint pages. Since 2010 runs on ASP.NET 3.5.1, it's easier to add CORS to your SharePoint application than 2013. With ASP.NET 4.0 and above you need to use a library like Thinktecture.IdentityModel (in the GAC) and add methods to the global.asax file of your application. Try adding this section to the <system.webServer>
element of your SharePoint web.config file:
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="http://externaldomain"/>
<add name="Access-Control-Allow-Headers" value="Content-Type, Accept, X-Requested-With, X-File-Name"/>
<add name="Access-Control-Allow-Methods" value="GET, POST"/>
</customHeaders>
</httpProtocol>
If using jQuery, your request will resemble the following:
$.ajax.support.cors = true; //enable CORS support, default is true in v1.9+
var listName = "Your List Name".replace(/\s/g, ''); //no white spaces
var filter = encodeURI("?$filter=Title eq 'some title'");
$.ajax({
url: "http://yoursharepointsite.com/_vti_bin/listdata.svc/" + listName + filter,
type: "POST",
cache: false,
contentType: "text/xml; charset=utf-8",
username: "username",
password: "password",
dataType: "xml"
})
.done(function(xmlDoc, status, responseObj) {
//handle
})
.fail(function(xmlDoc, status, responseObj) {
//handle
})
.always(function() {
//handle
});
You can also retrieve list information with SOAP:
var listName = "yourListName";
var packet = '<?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><GetList xmlns="http://schemas.microsoft.com/sharepoint/soap/"><listName>' + listName + '</listName></GetList></soap:Body></soap:Envelope>';
$.ajax({
url: "http://yoursharepointsite.com/_vti_bin/lists.asmx",
type: "POST",
dataType: "xml",
data: packet,
headers: {
"SOAPAction": "http://schemas.microsoft.com/sharepoint/soap/GetList",
"Content-Type": "text/xml; charset=utf-8"
}
}).done(function(xmlDoc, status, responseObj) {
//handle
})
.fail(function(xmlDoc, status, responseObj) {
//handle
})
.always(function() {
//handle
});