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 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.

Batch burst mode (Figure 5.1) is a test tool mode for testing for errors in the field mappings between a given BC/NAV version and a DW solution. It is primarily useful when testing for potential upgrade issues, but may also uncover other sources of mapping errors.

Figure 5.1 Batch burst mode

To use this tool:

  1. Switch to the batch burst mode tab (Figure 5.2)
  2. In the Request field write the GetAllEcomData request with an appriopriate language and shop id – e.g. <GetAllEcomData setlanguage="LANG1" shopID="SHOP1"></GetAllEcomData>
  3. Click Run
  4. Review the response

Every time the tool is run, the response XML is saved inside the TestTool folder in a structure replicating the Files/Integration/… structure used in Dynamicweb. This folder can then be zipped and moved to the Dynamicweb solution, where you can check if the response XML conforms to your expectations.

The easiest way to test this is by asking the tool to generate a set of data integration jobs and scheduled tasks inside the /Files/Integration folder. Then, in Dynamicweb, you can run these auto-generated tasks and check if they fail (Figure 5.2).

Figure 5.2 Generated scheduled tasks

Please note

  • This is not built for production environments, it absolutely will fail for 100.000s of customers or products. It is a test tool, use it accordingly.
  • This is not a shortcut for generating actual scheduled tasks for an integration – it generates simple tasks with no add-ins referencing auto-generated and auto-mapped integration jobs pointing to the generated files. It is a test tool, use it accordingly.