We have done this on many web services we have set up, and will soon be doing this for Sharepoint as well. As you say, you can get the data in XML. So you just need to
1) Retrieve the XML data
2) Parse the XML data
3) Return the now readable data in a block in Drupal
For 1 you need to open any firewall access and provide a publicly readable XML feed or set it only accessible by the IP of the Drupal server or some other authentication mechanism.
For 2PHP gives you many options on how to parse the XML. We created one module to handle the XML service, and then we call it from another module which handles the display, theme, etc. Below I'll provide first an example of two functions from the XML module, and then an example of how you might use it in another module.
Here is from the XML module.
/**
* Retrieving XML data from the URL
*
* @param $url
* The url to retrieve the data
* @param $replace_special_characters
* Replace special character to HTML format
*
* @return parse result as struct
*/
function xmlservice_parse($url, $replace_special_characters = FALSE) {
$http_contents = drupal_http_request($url);
if (!isset($http_contents->data)) {
throw new RuntimeException("Cannot get contents from the URL");
}//if
if($replace_special_characters)
$http_contents_data = str_replace('&','&', $http_contents->data);
else
$http_contents_data = $http_contents->data;
$xml_parser = xml_parser_create();
xml_parse_into_struct($xml_parser, $http_contents_data, $result);
xml_parser_free($xml_parser);
return $result;
}
/**
* Retrieving XML data as Dom document from the URL
*
* @param $url
* The url to retrieve the data
* @param $replace_special_characters
* Replace special character to HTML format
*
* @return result as Dom Document
*/
function xmlservice_parse_to_dom($url, $replace_special_characters = FALSE) {
$http_contents = drupal_http_request($url);
if (isset($http_contents->error)) {
throw new RuntimeException($http_contents->error);
}//if
if (!isset($http_contents->data)) {
throw new RuntimeException("Cannot get contents from the URL");
}//if
if($replace_special_characters){
$http_contents_data = str_replace('&','&', $http_contents->data);
}//if
else{
$http_contents_data = $http_contents->data;
}//else
$dom_document = new DomDocument;
/* load htmlinto object */
$dom_document->loadXML($http_contents_data);
/* discard white space */
$dom_document->preserveWhiteSpace = false;
return $dom_document;
}
Then just write your code to create a block. If you don't know how to do that, check out http://www.nowarninglabel.com/home/creating-a-new-custom-module-in-drupal-6 which creates a simple block. Then for the content you can just call one of the above functions on a XML document, for instance $content = xml_service_parse('http://sharepoint.example.com/some/thing/feed.xml');
If you want to parse into a node, you could just use the XML function but instead use node_save() to programmatically create a node: http://api.drupal.org/api/function/node_save
I haven't looked too much at the Sharepoint services available yet, but you could probably just parse the XML into a dom document like shown above and then do a loop through it creating a node for each XML node that matches your criteria.
And if you wanted more of the work done for
Hope that was helpful. Feel free to ask for more detail.