Wednesday, 18 April 2007

Windows Desktop Search: Searching Sharepoint

I'm getting on very well with Windows Desktop Search (see earlier post). The integration with Outlook is better than I had with Google Desktop.

One more thing will make my life much easier: the ability to trawl a cetain remote Sharepoint site. I have access to the site in question using Windows authentication and the WebDav (aka web folder) address of http://somesite/Intranet/Hidden Folder/InterestingDocuments.

I don't think there is any way to point WDS at a web folder - I tried specifying one in the UNC box but it wasn't accepted.

On the other hand it is just about possible to mount a web folder as a drive letter and get WDS to index it.

I hit some problems in my situation:
  • I don't have access to Intranet, only to the folders underneath.
  • Hidden Folder has a space in it - and the net use command fails with this, even if it is encoded as %20.
These are surmountable if I mount the hidden level as a drive letter and then explicity add the folders underneath to the list of folders to index.

Mapping the Drive

In a command prompt:
net use M: "http://somesite/Intranet" /persistent:yes
A dir m:\ shows no files because it is hidden from me. This is okay - I don't have permission to list the folder contents but I can access folders underneath if I know their names.

Indexing the Folder

To add the original folder to WDS, I opened the Indexing Options in Control Panel, clicked Advanced and then added m:\
Hidden Folder/InterestingDocuments
under the Add UNC Location tab.

That's it - just let the indexing engine gradually trawl the sharepoint folders across the network.

Searching

Searches will then include results from the sharepoint folders, but if I want to I can add a search condition to only search under those folders:

e.g. title:"Web Services" kind:docs under:InterestingDocuments

Wednesday, 11 April 2007

Windows Desktop Search

I recently uninstalled Google Desktop Search after watching a demo of an exploit. Although the particular case seems to be fixed it looks like the feature of mixing the local with web results opens the door to a whole family of similar exploits. Ideally I'd be able to just turn off the Desktop Link feature. Until then I'm looking for another solution.

Windows Desktop Search is shipped with Vista but is also available as a free download for earlier Windows. It comes with a set of filters and a plug-in for Outlook (which is presumably the result of this buyout.

There are also a number of third-party filters available.

Just waiting for the indexing service to complete it's first run, then hopefully I can find emails again...

It looks like WDS also had an XSS attack vulnerability: see advisory and patches.

Monday, 2 April 2007

Packaging WSDL

It's often a good thing to reference XML Schema documents from WSDL so that common types are not duplicated in multiple WSDL files.

On the other hand not all tooling will handle referenced schemas and it is necessary to embed the schema in the WSDL.

This XSLT transformation will turn a WSDL containing references to other schemas into an equivalent WSDL that embeds those schemas inline.


<?xml version="1.0"?>

<!--
This stylesheet will embed any schemas referenced with an 'import' element so an
equivalent standalone WSDL is created. This is necessary for tools that don't work with
referenced schemas.

-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<xsl:output method="xml" indent="no"/>

<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>

<xsl:template match="wsdl:types">
<xsl:copy>
<xsl:apply-templates select="xsd:schema/xsd:import" mode="embed" />
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>

<xsl:template match="xsd:import">
<xsd:import>
<xsl:attribute name="namespace"><xsl:value-of select="@namespace" /></xsl:attribute>
</xsd:import>
</xsl:template>

<xsl:template match="xsd:import" mode="embed">
<xsl:apply-templates select="document(@schemaLocation)" />
</xsl:template>

</xsl:stylesheet>