Seapine Labs
Personal tools

SDK C++ Tutorial

From Seapine Labs

Jump to: navigation, search

This article is a work in progress


This article includes everything you ever wanted to know about writing TestTrack SDK applications in C++! Don't like C++? Use the Java, VB or Python tutorials. Be sure to check out the TestTrack SDK Help pages for more information.

Want Seapine to write your SOAP app for you? Email us for more information.

Contents

[edit] Getting Started

You must install the TestTrack SDK as part of your server installation. If you haven't done this, you'll need to run the TestTrack installer for the version you have installed. Once installed, there are 2 files of interest.

  • http://yourserver/cgi-bin/ttsoapcgi.exe - CGI Executable that all TestTrack SDK commands go through. It's not important to understand CGI, just know where this file was installed.
  • http://server/ttsoapcgi.wsdl - The WSDL file that defines the language you use when talking to the CGI executable. Anyone that uses the TestTrack SDK uses this wsdl, there is no need to generate a specific wsdl for your installation. Everything is genericized so that, no matter how you customize TestTrack, this one wsdl file will handle it.

Once you've installed the TestTrack SDK, you can pull it into Visual Studio. Within your Visual Studio project, right-click the project and choose Add Web Reference. In the URL field, type in the address to your TestTrack SDK installation, something like:

http://myserver/ttsoapcgi.wsdl

Click Go. Visual Studio should find one web reference at that address. Change the Web reference name to TTSoap then click Add Reference.

An alternative method is to generate the stub code manually, from the wsdl. The downside is you'll have to do this again anytime you upgrade to a newer version of TestTrack.

[edit] Create a Connection

The TestTrack SDK requires authentication before you can retrieve and save data.


Things to Know:

  • You cannot logon via the TestTrack SDK if you are already logged in via one of the TestTrack clients. It's best to use a dedicated account for your SDK scripting, this ensures you'll always be able to login.
  • If you do not explicitly call DatabaseLogoff, your user will remain logged in until the TestTrack SDK times out. This could present a problem if you try to re-run the script inside that timeframe. It's important to use try/catch exception handling to ensure that an exception in your program doesn't skip logging you off.
  • The CProjectDataOption array governs what licenses you use and functionality you have access to. For example, you can't use a TestTrack TCM license if you don't specify one in the CProjectDataOption array.

[edit] Query Objects

There are two ways to retrieve data through the TestTrack SDK. You can explicitly call a getObject method or you can call the getRecordListForTable method.

[edit] Troubleshooting

With C# and Visual Studio, using the TestTrack SDK is pretty simple but it never hurts to have some tools to help with debugging.

  • MS SOAP Toolkit - This is a small app from Microsoft that helps you trace SOAP requests. Start a formatted trace, point your SOAP client toward the tools listening port, then have the tool redirect to the real web server port. With that configured, you can intercept the response/request loop and see exactly what is being communicated to the TestTrack Server.
  • soap UI - A free tool that lets you send raw SOAP envelopes. We sometimes use this internally to debug issues, since you can control the data being being sent. Going through C#, you're depending on their parser to translate objects into XML and pass those to the server.













Issue Management Software | Source Code Control Software | Test Case Management