Main Content

创建一个. netMATLABProduction ServerClient

To create aMATLAB®Production Server™client:

  1. Obtain the client runtime files located in$MPS_INSTALL/client/dotnet. You can also download the client runtime files fromMATLAB 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. 与appro配置你的系统priate software for working with .NET.

    SeePrepare Your Microsoft Visual Studio Environment.

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

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

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

    2. Declare and throw exceptions as required.

    3. Free system resources using theclosemethod ofMWClient, 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 HTTPContent-Typerequest header toapplication/x-google-protobufin 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