Module - WSServer Client (WSServer Client)

This module implements the Java WebService CLI Client and Java Client Library (SOAP & REST) for the GRID Access Layer.

About

This module builds an All-In-One package containing command line clients for common operations like "sending files", "retrieving files" and "generating test data" and it also is a shared library simplifying accessing the GRID when using the Java programming language.

Note: As the GRID uses common SOAP and REST based interfaces, any other language may be used to build a client. Also when using Java there's no need to use the provided client library, however doing so simplifies the communication with the GRID as a clean library can be offered containing hand coded data types and constructors.

Quick Start - Command Line Client

Get the All-In-One Client package

  • Download the aggregate JAR containing all required 3rd party libraries from here: gacl-client-1.2.4-RC.jar.
  • Open a new console window and get an overview on the contained clients by executing:
    java -jar gacl-client-1.2.4-RC.jar
    

Quick Start - Client API

Available Maven Artifacts:

<dependencies>
    <dependency>
        <groupId>com.trendmicro.grid.acl</groupId>
        <artifactId>gacl-client-library</artifactId>
        <version>1.2.4-RC</version>
    </dependency>
</dependencies>

<repositories>
    <repository>
        <id>mygacl.trendmicro.com</id>
        <url>https://mygacl.trendmicro.com/doc/ws-server/ws-server-client</url>
    </repository>
</repositories>

Artifacts Explained:

  • gacl-client-library-1.2.4-RC.jar provides a pre-built client library that helps accessing the content of the GRID and is packaged as an aggregate JAR containing all required 3rd party libraries.

    Notes:

    • All 3rd party packages were relocated to the package "internal.." to avoid conflicts. (It is strongly recommended NOT using libraries that were packaged with "internal" within your code!)
    • This jar was compiled for Java 1.6 or later and depends on:
  • gacl-client-library-1.2.4-RC-sources.jar is the source code package to the aggregate JAR which is provided for documentation and debugging purpose.

Creating a Project:

  • Options:
    • Option 1: Start a new Maven based project using your favorite IDE and include the dependency and repository from above.
    • Option 2: Use the offered Maven project template:
      • Download and extract the template from here: ./gacl-client-maven-project.zip.
      • Open it in a Maven enabled IDE like IntelliJ IDEA, Netbeans or Eclipse. (Choose "Create Project from Maven model" or similar depending on the IDE)
    • Option 3:Alternatively start using your favorite IDE, create a new project and setup the downloaded JAR as a library. If you choose this option it is highly recommended that you also attach the provided source code package with the downloaded JAR as this enables code navigation, full debugging and documentation (white-box instead of black-box).
  • Copy & Paste the following sample code into the main class to begin with:
    public class Main {
            public static void main(String[] args) {
                    boolean useSSL = true;
                    ServiceClient client = new ServiceClient("mygacl.trendmicro.com", 0, useSSL);
    
                    PublicAuthenticationService authService = client.getPort(PublicAuthenticationService.class);
                    if (!authService.isAuthenticated())
                            authService.authenticate("guest", new char[] {'p', 'w'});
    
                    PublicFileService fileService = client.getPort(PublicFileService.class);
                    FileIdentifier fid = new FileIdentifier(args[0]);
                    FileInformation info = fileService.getFileInformation(fid);
    
                    System.out.println(info);
            }
    }
    
  • Create a run configuration for the main class and execute it with the argument "7eb0139d2175739b3ccb0d1110067820be6abd29" (= sha1 of Win7 'notepad.exe').
  • Checkout "Client API Usage" for further information on how the API is used.

View Examples: