Start Transaction

Note: A one second timeout must be applied between the ’StartTransaction’ command and the start of the actual transaction.

Start Transactions can be performed in two ways:

  1. Using existing transaction entity created before, in this case user sends transactionId (from create Transaction Entity Step) only in the body of requests
  2. Create and start transaction immediately. In this case send transaction name and description. A newly created transaction will be started immediately.

Parameters:

  • transactionName: The transaction name
  • transactionManagerSessionIdentifiers: Transaction session identifiers, as given during Connect. These identifiers will be used during the whole session (connect, start and end transaction and disconnect).
  • transactionDescription: (optional)
  • transactionId: as given on create transaction entity

Return value:

transactionIdentifier: The transaction identifier that will be used for the stop transaction command.

Example: Create a new transaction and start it immediately.

Request

JSON

URL http://ip:port/shunra/api/transactionmanager/transaction/{transactionManagerSessionIdentifier}
HTTP Method POST
HTTP Headers

Content-Type: application/json

Accept: application/json

Authorization: See Web Services Authentication.

Body
{
    "transactionName": "transaction1",
    "transactionDescription": "Login transaction"
}

XML

URL http://ip:port/shunra/api/transactionmanager/transaction/{transactionManagerSessionIdentifier}
HTTP Method POST
HTTP Headers

Content-Type: application/xml

Accept: application/xml

Authorization: See Web Services Authentication.

Body
<startTransactionRequest>
    <transactionName>login</transactionName>
    <transactionDescription>Login
    transaction</transactionDescription>
</startTransactionRequest>

 

Example: Start existing transaction

JSON

URL http://ip:port/shunra/api/transactionmanager/transaction/{transactionManagerSessionIdentifier}
HTTP Method POST
HTTP Headers

Content-Type: application/json

Accept: application/json

Authorization: See Web Services Authentication.

Body
{
    "transactionId": "e444e1f1-f55f-480a-9de9-ae587e16a0a1"
}

XML

URL http://ip:port/shunra/api/transactionmanager/transaction/{transactionManagerSessionIdentifier}
HTTP Method POST
HTTP Headers

Content-Type: application/xml

Accept: application/xml

Authorization: See Web Services Authentication.

Body
<startTransactionRequest>
     <transactionId>e444e1f1-f55f-480a-9de9-ae587e16a0a1</transactionId>
</startTransactionRequest>

Response

JSON and XML

HTTP Response Code 200 - OK
HTTP Headers

Date: Thu, 15 Mar 2014 15:36:11 GMT

Content-Type: application/json; charset=UTF-8

Accept-Ranges: bytes

HTTP Body
{
    transactionIdentifier: "e16645fa-6f96-4707-b884-fe46b872e3a436434aa6-ae80-4ace-8009-8ee8c970e689"
    transactionEntity: {
        id: "e16645fa-6f96-4707-b884-fe46b872e3a4"
        name: "transaction1"
        description: "Login transaction"
        averageUserTime: 0
        averageNetworkTime: 0
        orderNum: 0
        runs: {
            36434 aa6 - ae80 - 4 ace - 8009 - 8e e8c970e689: {
                id: "36434aa6-ae80-4ace-8009-8ee8c970e689"
                startTime: 1382461475606
                endTime: 0
                userTime: 0
                networkTime: 0
                status: "Start"
                averageBandwith: 0
                totalThroughputClient: 0
                totalThroughputServer: 0
                aggregateScore: 0
                numberOfErrors: 0
                applicationTurns: 0
                protocolOverhead: 0
                passed: true
            }
        }
    }
}

XML:
<?xml version="1.0" encoding="UTF-8"?>
<transactionResponse>
   <transactionIdentifier>e444e1f1-f55f-480a-9de9-ae587e16a0a1e9204852-6e3d-4416-b952-e8f7a67ff250</transactionIdentifier>
   <transactionEntity>
      <name>transaction1</name>
      <description>Login transaction</description>
      <orderNum>1</orderNum>
      <averageUserTime>836228.0</averageUserTime>
      <averageNetworkTime>0.0</averageNetworkTime>
      <runs>
         <entry>
            <key>4e5f487c-dcb2-454d-9215-ec38fd641a46</key>
            <value>
               <startTime>1382108358565</startTime>
               <endTime>1382109194793</endTime>
               <userTime>0.0</userTime>
               <networkTime>0.0</networkTime>
               <status>Stop</status>
               <networkScenario>3G</networkScenario>
               <averageBandwith>0.0</averageBandwith>
               <totalThroughputClient>0</totalThroughputClient>
               <totalThroughputServer>0</totalThroughputServer>
               <aggregateScore>0.0</aggregateScore>
               <numberOfErrors>0</numberOfErrors>
               <applicationTurns>0</applicationTurns>
               <protocolOverhead>0</protocolOverhead>
               <id>4e5f487c-dcb2-454d-9215-ec38fd641a46</id>
            </value>
         </entry>
      </runs>
      <id>e444e1f1-f55f-480a-9de9-ae587e16a0a1</id>
   </transactionEntity>
</transactionResponse>