Main Content

Create a .NET MATLAB Production Server Client

To create a MATLAB® Production Server™ client:

  1. Obtain the client runtime files located in $MPS_INSTALL/client/dotnet. You can also download the client runtime files from MATLAB Production Server Client Libraries.

  2. In consultation with the MATLAB programmer, agree on the MATLAB function signatures that comprise the services in the application.

  3. Configure your system with the appropriate software for working with .NET.

    See Prepare Your Microsoft Visual Studio Environment.

  4. Based on your requirements, decide if the client uses a static proxy or a dynamic proxy, or the MATLAB Production Server RESTful API for MATLAB Function Execution.

  5. If your client uses a proxy, write .NET code to instantiate a proxy to a MATLAB Production Server instance and call the MATLAB functions.

    1. Create a dynamic proxy for communicating with the service hosted by MATLAB Production Server.

    2. Declare and throw exceptions as required.

    3. Free system resources using the close method of MWClient, after making needed calls to your application.

  6. If your client uses the RESTful API, to use protobuf when making a request to the server, set the HTTP Content-Type request header to application/x-google-protobuf in the client code. The .NET client library provides helper classes to internally create protobuf messages based on a proto format and returns the corresponding byte array. Use this byte array in the HTTP request body. The .NET client library provides methods and classes to deserialize the protobuf responses.

Related Topics