Dynamicweb Connector TestTool

The Dynamicweb Connector test tool is a small and very useful tool which allows you to submit requests and receive responses from web services – either:

  • Directly to a web service exposed by a remote system plugin
  • Indirectly via the web service exposed by the Dynamicweb Connector service – this is typically used to test the connection between the connector service and the remote system plugin.

To use the test tool, download it from the documentation portal – you must be logged in to access the files – and unpack it in an appropriate location, depending on your setup. In some scenarios, you want it placed on the same network as the remote system, in other cases it might make sense to place it on a perimeter network.

Run DynamicwebConnectorTestTool.exe to open the testtool interface (Figure 1.1) – to query a web service:

  1. Select an endpoint
  2. Select a code example request – this is of course optional, you can always write your own requests or modify the code example
  3. Click Run Test
  4. Examine the Response
  5. Save the request as a code example or the response as an XML file
Figure 1.1 The TestTool interface

Recommended process

If you follow the recommended project process, you will first install the TestTool on the remote environment, and use it to query the remote system for data, which you will then deliver to the Dynamicweb side of the integration. They will use this data to create import jobs and develop the solution against real data, which helps the project stay on track.

There are two types of endpoints for the test tool:

  • Web services from a Dynamicweb ConnectorService instance
  • Web services from a remote system plugin unit

To connect to a Dynamicweb ConnectorService instance:

  1. Select DynamicwebService as the endpoint
  2. Enter the web service URL and secret

If you have more than one connector service web service to test you can use the arrow-buttons to cycle between them (Figure 2.1).

Figure 2.1 Connecting to ConnectorService endpoints

To connect to a web service exposed by a remote system plugin unit you must open and edit the DynamicwebConnectorTestTool.exe.config file – it contains a number of config sections with settings for connecting to remote systems. It is identical to the config file for the Connector Service – read more about it here.

When the config file is ready, simply select the appropriate connector using the dropdown and run the tests as normal (Figure 2.2).

Figure 2.2 Connecting to a remote system

The XPATH tab allows you to filter responses by using path expressions, showing only a specific subset of data from the response. This is useful for basic debugging purposes.

To use XPATH:

  • Switch to the XPath tab
  • Enter an XPath – e.g. //item[column[@columnName='ProductNumber']='D0005'], which finds products by product number
  • Click Run Test

The XSLT tab allows you to transform the response XML before showing it in the Transformed Response tab.

This is useful in more advanced debugging scenarios, or if you’re coding against a passive remote system which is unable to process and deliver data in the XML format required by Dynamicweb. This example will find a product by product number:

XML
<?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"> <xsl:output method="xml" indent="yes"/> <xsl:template match="/"> <XML> <xsl:apply-templates select="//item[column[@columnName='ProductNumber']='D0005']"/> </XML> </xsl:template> <xsl:template match="item"> <xsl:copy-of select="."/> </xsl:template> </xsl:stylesheet>

The transformed response is shown on the Transformed Response tab.