ScrumWorks Pro SOAP API

The Scrumworks Pro product has an API that works using SOAP calls, and I needed to LoadTest the application using this interface.
I immediately had some problems with it since there seemed to be no documentation at all for non-Java developers. A had a JavaDoc that really didn’t tell me anything (as I’m not a Java developer), and the only raw SOAP example I had was one Danube’s support sent me, which didn’t work for me as it was meant for other tools than LoadRunner …

Doing it the hard way

I now had to figure out how the SOAP calls where made in LoadRunner.

The first thing was the authentication; I had a username and password and concluded that for LoadRunner SOAP calls I needed to add the correct HTTP header information. I also needed to modify some other headers as well, and the final code looked like this:

  web_set_max_html_param_len("10240");
  web_set_user("[Username]", "[Password]", "[Domain:Port]");
  web_add_header("Accept-Charset", "UTF-8");
  web_add_header("SOAPAction", "\"\"");
  web_add_header("Content-Type", "application/soap+xml; charset=utf-8");

You of course need to replace [Username], [Password] and [Domain:Port] !

So finally I managed to get it all working, using the WSDL and the example I got + a lot of manual trial & error work. This took me more than 2 days to figure out, but went faster and faster as I discovered how it really works …

In the end I realized that each SOAP call that wanted parameters needed to have the whole parameters structure sent for it. As an example the ‘getReleases’ method want s to have a ProductWSO structure, and that means sending all the properties of the structure (see examples below).

Example of ‘getProducts’ and ‘getReleases’

  web_reg_save_param("xml",
    "LB=",
    "RB=",
    "Ord=All",
    "Notfound=Warning",
    LAST );

  web_reg_save_param("faultstring",
    "LB=",
    "RB=",
    "Notfound=Warning",
    LAST );

  lr_start_transaction("soap_getProducts");</p>

  web_custom_request( "getProducts",
    "URL={BaseURL}:8080/scrumworks-api/scrumworks",
    "Method=POST",
    "Resource=0",
    "RecContentType=application/soap+xml",
    "Mode=HTTP",
    "EncType=application/soap+xml; charset=utf-8",
    "Body="
    "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
    "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" "
    "xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" "
    "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"> "
    "<soap:Body>"
    " <getProducts xmlns=\"http://api.scrumworks.danube.com/ScrumWorks/types\"/>"
    "</soap:Body>"
    "</soap:Envelope>",
    LAST);

  lr_end_transaction("soap_getProducts", LR_AUTO);

  if ( strlen(lr_eval_string("{faultstring}")) > 0 )
  {
    lr_error_message("getProducts::%s", lr_eval_string("{faultstring}")) ;
    return 0;
  } else return -1;

  web_reg_save_param("xml",
    "LB=<result>",
    "RB=</result>",
    "Ord=All",
    "Notfound=Warning",
    LAST );

  web_reg_save_param("faultstring",
    "LB=<faultstring>",
    "RB=</faultstring>",
    "Notfound=Warning",
    LAST );

  // --------------------------------------------------------------------------
  // And here's the getReleases SOAP call
  // You need to replace the "ProdctID" with a ProductID you received in the previous call</p>

  lr_save_string( ProductID, "ProductID" );</p>

  lr_start_transaction("soap_getReleases");</p>

  web_custom_request( "getReleases",
    "URL={BaseURL}:8080/scrumworks-api/scrumworks",
    "Method=POST",
    "Resource=0",
    "RecContentType=application/soap+xml",
    "Mode=HTTP",
    "EncType=application/soap+xml; charset=utf-8",
    "Body="
    "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
    "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" "
    "xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" "
    "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"> "
    "<soap:Body>"
    " <getReleases xmlns=\"http://api.scrumworks.danube.com/ScrumWorks/types\">"
    " <ProductWSO_1 xmlns=\"\">"
    "  <businessWeightUnits xsi:nil=\"true\"/>"
    "  <effortUnits xsi:nil=\"true\"/>"
    "  <id>{ProductID}</id>"
    "  <keyPrefix xsi:nil=\"true\"/>"
    "  <name xsi:nil=\"true\"/>"
    "  <programId xsi:nil=\"true\"/>"
    "  <roiDecimalPlaces>2</roiDecimalPlaces>"
    "  <trackTimeSpent>false</trackTimeSpent>"
    " </ProductWSO_1>"
    " </getReleases>"
    "</soap:Body>"
    "</soap:Envelope>",
    LAST);

  lr_end_transaction("soap_getReleases", LR_AUTO);</p>

  if ( strlen(lr_eval_string("{faultstring}")) > 0 )
  {
    lr_error_message("getReleases::%s",lr_eval_string("{faultstring}")) ;
  }

To view test results click here.

Advertisements

3 thoughts on “ScrumWorks Pro SOAP API

  1. Kim, I’m not the expert at the SOAP stuff, but I am aware my company (Danube) made some performance improvements since this blog was first posted in the 3.2 release http://danube.com/scrumworks/pro/release/3.2.

    Also, the pending release is expected to have dramatic performance improvements — I overheard one load test taking one tenth the time as before on the development build. Stay tuned for that.

    –mj
    Michael James
    Danube Technologies, Inc.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s