Recording actions

StartRecording

Description

The StartRecording method starts a recording in proxy mode (tunnel mode is not supported by the Design API). This call is synchronous - it blocks until the recording has started.

Parameters

REST example

POST http://localhost:7400/Design/v1/Service.svc/StartRecording HTTP/1.1
Accept: application/json
Content-Type:application/json
Cache-Control:nocache
Pragma: nocache
User-Agent:Java/1.7.0_10
Host: localhost:7400
Connection: keepalive
Content-Length:276

{"d": {
     "VirtualUser": "myVirtualUserName",
     "BaseContainer": "Init",
     "ProtocolWebSocket": true,
     "ProtocolAdobeRTMP": false,
     "UserAgent": null
}}

REST example that starts an SAP recording by associating with an existing SAP session

POST http://localhost:7400/Design/v1/Service.svc/StartRecording HTTP/1.1
Accept: application/json
Content-Type:application/json
Cache-Control:nocache
Pragma: nocache
User-Agent:Java/1.7.0_10
Host: localhost:7400
Connection: keepalive
Content-Length:276
{"d":{
      "ProtocolSAPGUI": true,
      "SAPSessionID": "/app/con[0]/ses[0]"
    }
} 

Use case with Command Line Designer

java -cp "api/Common/java/*;api/Design API Client/java/*" com.neotys.rest.design.client.CommandLineDesigner -designAPIURL http://localhost:7400/Design/v1/Service.svc/ -command StartRecording -VirtualUser myVU -BaseContainer Init -ProtocolWebSocket -ProtocolAdobeRTMP -UserAgent myUserAgent

Use case with Java Client Designer

import com.neotys.rest.design.client.DesignAPIClient;
import com.neotys.rest.design.client.DesignAPIClientFactory;
import com.neotys.rest.design.model.StartRecordingParams.StartRecordingBuilder;

public class Main {

	public static void main(String[] args) throws Exception {

		final String url = "http://localhost:7400/Design/v1/Service.svc";
		final DesignAPIClient client = DesignAPIClientFactory.newClient(url);
		final StartRecordingBuilder builder = new StartRecordingBuilder().virtualUser("VirtualUserName");
		client.startRecording(builder.build());
	}
}

Example with Java Client Designer that starts an SAP recording by creating a new SAP session

import com.neotys.rest.design.client.DesignAPIClient;
import com.neotys.rest.design.client.DesignAPIClientFactory;
import com.neotys.rest.design.model.StartRecordingParams.StartRecordingBuilder;
import com.neotys.rest.design.model.StartRecordingInfo;
public class Main {
	public static void main(String[] args) throws Exception {
		final String url = "http://localhost:7400/Design/v1/Service.svc";
		final DesignAPIClient client = DesignAPIClientFactory.newClient(url);
		final StartRecordingBuilder builder = new StartRecordingBuilder().isSapGuiProtocol(true)
				.sapConnectionString("/SAP_CODEPAGE=1100  /FULLMENU  127.0.0.1 45 /3 /UPDOWNLOAD_CP=2");

		final StartRecordingInfo info = client.startRecording(builder.build());
System.out.println("sap session ID: "+info.getSapSessionId().or("") );
	}
}

Use case with C#Client

using Neotys.DesignAPI.Client;
using Neotys.DesignAPI.Model;

namespace Design
{
    class StartRecording
    {
        static void Main(string[] args)
        {
            string url = "http://localhost:7400/Design/v1/Service.svc/";
            IDesignAPIClient client = DesignAPIClientFactory.NewClient(url);
            client.StartRecording(new StartRecordingParamsBuilder()
.virtualUser("VirtualUserName")
.Build());
        }
    }
}


Example with c# Client that starts an SAP recording by creating a new SAP Session

using Neotys.DesignAPI.Client;
using Neotys.DesignAPI.Model;

namespace TestDesignApi
{
    class Program
    {
        static void Main(string[] args)
        {
            IDesignAPIClient client = DesignAPIClientFactory.NewClient("http://localhost:7400/Design/v1/Service.svc/");
            var info = client.StartRecording(new StartRecordingParamsBuilder().isSapGuiProtocol(true)
                   .sapConnectionString("/SAP_CODEPAGE=1100  /FULLMENU  127.0.0.1 45 /3 /UPDOWNLOAD_CP=2")
                   .Build());
             System.Console.WriteLine("session id "+ info.SapSessionId);
        }
    }
}