This project is read-only.

XsltDb as web service host

A particular XsltDb module can be accessed as a web servise via url like http://yoursite.com/DesktopModules/XsltDb/ws.aspx?service=<<Module Alias>>. The module can accept url paramters ( access using mdo:request ) and has request body as input XML.

You can optionally specify content type as a URL parameter:
  • http://yoursite.com/DesktopModules/XsltDb/ws.aspx?service=<<Module Alias>>&content-type=text/xml
Or you can put a service-conten-type directive on the top of configuration:
  • ##service-content-type application/x-javascript
Using this you can provide a parameterised javascript (as Gogle Analytics, etc.)

The following service returns a list of modules currently installed in DNN

aliased_service.PNG

<xsl:variable name="mods" select="mdo:sql('select * from {databaseOwner}[{objectQualifier}DesktopModules]', 'mod')" />
<mods>
  <xsl:for-each select="$mods//mod">
    <mod id="{DesktopModuleID}">
      <name>{{FriendlyName}}</name>
      <description>{{Description}}</description>
    </mod>
  </xsl:for-each>
</mods>
To execute this code you must check "Super Module" check box (above the XSLT edit box) as it requres access to DNN data. After you created the module you can access it by the URL like the follwing http://yoursite.com/DesktopModules/XsltDb/ws.aspx?service=modules. You can also add parameters in the url and access them with mdo:request extension. Within the XSLT you can access database to store or retrieve any data you need.

web-service.PNG

Last edited Jan 17, 2011 at 8:00 AM by findy, version 6

Comments

No comments yet.