Testing and debugging services
This presentation is part of the Services and Connectors Self-Study Course.
There are many facilities to help test out your services:
- Clipboard: Make use of the clipboard throughout your unit testing.
- Unit Test Service Activities: You can individually unit test your service activity prior to creating a service package and service rule. It can be unit tested in the same way that you would unit test other activities. Remember that once the service rule is created; the service rule will be doing things like creating a Page, executing a Model, and setting data from the Request. You can create a wrapper activity (that calls the service activity) to set up some of these things, and then unit test by running the wrapper activity.
- Unit Test Specialized Rules: If you are using specialized rules in your data transformations, they can be individually unit tested outside of testing your service rule or service activity. For instance, there is a Run icon available on a Rule-Parse-XML rule. This allows you to enter the text to be parsed in several different ways, and then see the results of the parse.
- Unit Test Service Rules: There is a run icon available on a service rule that allows you to unit test it. By unit testing a service rule you can not only test the service activity, but the data transformations as well. You will be prompted to enter in Request parameters, and if execution is successful, you can see the Response parameter result. When testing, you can also identify whether you are going to use the logged in Requestor context or a completely new Requestor context. If you use the logged in Requestor context, then you can see the results in the Clipboard viewer.
- Trace Open Rule: For some service rules you can perform a Trace Open Rule on the service rule. This opens up a tracer session and you can trace the service rule, not just the service activity. To make this work you need to select Services in the trace options. The trace output for a service will show you the data transformations that take place during Request and Response.
- Tracer: For some service rule types you can open up a tracer session and see the results when testing directly from the external client application. This is very specific to the service type. It works for Soap and .Net because these communicate via HTTP.
- PAL: You can run PAL to individually test out your service rules and service activities. It is also possible to write PAL statistics to a log file using the PAL API.
- prlogging.xml: You can log the execution of PRPC classes that support service processing by configuring the classes in prlogging.xml.
- Alerts: There are different options for configuring alerts that are relevant to services. Configuration is done in prconfig.xml.